]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/cephadm: create empty nfs rados config obj
authorMichael Fritch <mfritch@suse.com>
Thu, 27 Feb 2020 14:24:52 +0000 (07:24 -0700)
committerMichael Fritch <mfritch@suse.com>
Wed, 25 Mar 2020 22:26:13 +0000 (16:26 -0600)
Signed-off-by: Michael Fritch <mfritch@suse.com>
src/pybind/mgr/cephadm/module.py
src/pybind/mgr/cephadm/nfs.py
src/pybind/mgr/cephadm/tests/test_cephadm.py

index 8a9c5e09f2bbb27b816e2ce6f52dac546ae77804..ee623f41944c24c92a1e97bcb3d456e53fa47969 100644 (file)
@@ -2795,6 +2795,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule):
         nfs = NFSGanesha(self, daemon_id, spec.pool, namespace=spec.namespace)
         keyring = nfs.create_keyring()
         cephadm_config = nfs.get_cephadm_config()
+        nfs.create_rados_config_obj()
         return self._create_daemon('nfs', daemon_id, host,
                                    keyring=keyring,
                                    cephadm_config=cephadm_config)
index 61b4812e0bc5c1fc1df2bcfdc0c1bedf9edb473c..75caf6caec3282f1853f3ad39b1612e29c51b78a 100644 (file)
@@ -46,6 +46,14 @@ class NFSGanesha(object):
         })
         return keyring
 
+    def create_rados_config_obj(self):
+        # type: () -> None
+        obj = self.get_rados_config_name()
+        with self.mgr.rados.open_ioctx(self.pool) as ioctx:
+            if self.namespace:
+                ioctx.set_namespace(self.namespace)
+            ioctx.write_full(obj, ''.encode('utf-8'))
+
     def get_ganesha_conf(self):
         # type: () -> str
         return '''# generated by cephadm
index eb4d0e2dfdadabf2ac5823ab9ed79dafa1594272..bd6f520267cee788746c0ea92af352c6a452a8fb 100644 (file)
@@ -260,6 +260,7 @@ class TestCephadm(object):
             match_glob(out, "Deployed rbd-mirror.* on host 'test'")
 
     @mock.patch("cephadm.module.CephadmOrchestrator._run_cephadm", _run_cephadm('{}'))
+    @mock.patch("cephadm.module.CephadmOrchestrator.rados", mock.MagicMock())
     def test_nfs(self, cephadm_module):
         with self._with_host(cephadm_module, 'test'):
             ps = PlacementSpec(hosts=['test'], count=1)