From 66994e5431ba9ab499962bc89d4f508b703f57de Mon Sep 17 00:00:00 2001 From: Suman Chakravartula Date: Wed, 30 Dec 2015 11:32:45 -0800 Subject: [PATCH] Admin host should take precedence when it's same as the client(s). Fixes #959 --- src/rockstor/storageadmin/views/nfs_exports.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/rockstor/storageadmin/views/nfs_exports.py b/src/rockstor/storageadmin/views/nfs_exports.py index 80e8a33fe..194a13198 100644 --- a/src/rockstor/storageadmin/views/nfs_exports.py +++ b/src/rockstor/storageadmin/views/nfs_exports.py @@ -41,12 +41,17 @@ def client_input(export): ci = {'client_str': eg.host_str, 'option_list': ('%s,%s,%s' % (eg.editable, eg.syncable, eg.mount_security))} - if (eg.nohide): - ci['option_list'] = ('%s,nohide' % ci['option_list']) + ci['mnt_pt'] = export.mount.replace(settings.NFS_EXPORT_ROOT, settings.MNT_PT) if (eg.admin_host is not None): - ci['admin_host'] = eg.admin_host + if (eg.admin_host == eg.host_str): + ci['option_list'] = ('rw,no_root_squash,%s,%s' % + (eg.syncable, eg.mount_security)) + else: + ci['admin_host'] = eg.admin_host + if (eg.nohide): + ci['option_list'] = ('%s,nohide' % ci['option_list']) return ci @staticmethod