From: Varsha Rao Date: Fri, 6 Mar 2020 20:19:30 +0000 (+0530) Subject: mgr/volumes: Improve readability of ganesha common config X-Git-Tag: v15.2.5~166^2~81 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=876cdd364171d0395c6580feb9c58ae617ddb37c;p=ceph.git mgr/volumes: Improve readability of ganesha common config Signed-off-by: Varsha Rao (cherry picked from commit 2b0f9646e237b3a5b748087c54adecaf2eb3104a) --- diff --git a/src/pybind/mgr/volumes/fs/nfs.py b/src/pybind/mgr/volumes/fs/nfs.py index 78eaf935efa1..8a59c0e5cc4e 100644 --- a/src/pybind/mgr/volumes/fs/nfs.py +++ b/src/pybind/mgr/volumes/fs/nfs.py @@ -192,13 +192,36 @@ class NFSConfig(object): return ret, out, err def create_common_config(self, nodeid): - result = "NFS_CORE_PARAM {\n Enable_NLM = false;\n Enable_RQUOTA = false;\n Protocols = 4;\n}\n\n" - result += "CACHEINODE {\n Dir_Chunk = 0;\n NParts = 1;\n Cache_Size = 1;\n}\n\n" - result += "NFSv4 {\n RecoveryBackend = rados_cluster;\n Minor_Versions = 1, 2;\n}\n\n" - result += "RADOS_URLS {{\n userid = {};\n}}\n\n".format(self.cluster_id) - #result += "%url rados://{}/{}/{}\n\n".format(self.pool_name, self.pool_ns, nodeid) - result += "%url rados://{}/{}/export-1\n\n".format(self.pool_name, self.pool_ns) - result += "RADOS_KV {{\n pool = {};\n namespace = {};\n UserId = {};\n nodeid = {};\n}}\n\n".format(self.pool_name, self.pool_ns, self.cluster_id, nodeid) + # TODO change rados url to "%url rados://{}/{}/{}".format(self.pool_name, self.pool_ns, nodeid) + result = """NFS_CORE_PARAM {{ + Enable_NLM = false; + Enable_RQUOTA = false; + Protocols = 4; + }} + + CACHEINODE {{ + Dir_Chunk = 0; + NParts = 1; + Cache_Size = 1; + }} + + NFSv4 {{ + RecoveryBackend = rados_cluster; + Minor_Versions = 1, 2; + }} + + RADOS_URLS {{ + userid = {2}; + }} + + %url rados://{0}/{1}/export-1 + + RADOS_KV {{ + pool = {0}; + namespace = {1}; + UserId = {2}; + nodeid = {3}; + }}""".format(self.pool_name, self.pool_ns, self.cluster_id, nodeid) #self.ganeshaconf._write_raw_config(result, nodeid) with self.mgr.rados.open_ioctx(self.pool_name) as ioctx: