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)
})
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
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)