]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/nfs: move export ganesha conf translation into caller
authorSage Weil <sage@newdream.net>
Wed, 26 May 2021 20:27:34 +0000 (16:27 -0400)
committerSage Weil <sage@newdream.net>
Thu, 17 Jun 2021 20:18:06 +0000 (16:18 -0400)
This belongs in the (one) caller, not the helper.

Signed-off-by: Sage Weil <sage@newdream.net>
src/pybind/mgr/nfs/export.py

index 84d46738112807ea38e402be8d399fba9aa2fae5..7031f7513047ab919122f5773dba6f0c4cb5997e 100644 (file)
@@ -45,9 +45,6 @@ class NFSRados:
         return {'block_name': '%url', 'value': self._make_rados_url(obj_name)}
 
     def write_obj(self, conf_block, obj, config_obj=''):
-        if 'export-' in obj:
-            conf_block = GaneshaConfParser.write_block(conf_block)
-
         with self.mgr.rados.open_ioctx(self.pool) as ioctx:
             ioctx.set_namespace(self.namespace)
             ioctx.write_full(obj, conf_block.encode('utf-8'))
@@ -231,8 +228,11 @@ class ExportMgr:
 
     def _save_export(self, export):
         self.exports[self.rados_namespace].append(export)
-        NFSRados(self.mgr, self.rados_namespace).write_obj(export.to_export_block(),
-                 f'export-{export.export_id}', f'conf-nfs.{export.cluster_id}')
+        NFSRados(self.mgr, self.rados_namespace).write_obj(
+            GaneshaConfParser.write_block(export.to_export_block()),
+            f'export-{export.export_id}',
+            f'conf-nfs.{export.cluster_id}'
+        )
 
     def _delete_export(self, cluster_id, pseudo_path, export_obj=None):
         try: