From: Redouane Kachach Date: Tue, 11 Jul 2023 08:01:39 +0000 (+0200) Subject: Addressing reviewers comments X-Git-Tag: v18.2.1~326^2~33 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=d7226206465c0a17a772446c2c0e89c5dd32e9b8;p=ceph.git Addressing reviewers comments Signed-off-by: Redouane Kachach (cherry picked from commit 5a043fe6d25fd986a5ccb55b4920922c1fcd0f22) --- diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index 268710f965c30..433979893976c 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -1041,10 +1041,10 @@ class CephNvmeof(object): @staticmethod def get_version(ctx: CephadmContext, container_id: str) -> Optional[str]: - out, err, ret = call_throws(ctx, [ - ctx.container_engine.path, 'inspect', - '--format', '{{index .Config.Labels "io.ceph.version"}}', - ctx.image]) + out, err, ret = call(ctx, + [ctx.container_engine.path, 'inspect', + '--format', '{{index .Config.Labels "io.ceph.version"}}', + ctx.image]) version = None if ret == 0: version = out.strip() @@ -4110,7 +4110,7 @@ def install_sysctl(ctx: CephadmContext, fsid: str, daemon_type: str) -> None: lines = HAproxy.get_sysctl_settings() elif daemon_type == 'keepalived': lines = Keepalived.get_sysctl_settings() - elif daemon_type == 'nvmeof': + elif daemon_type == CephNvmeof.daemon_type: lines = CephNvmeof.get_sysctl_settings() lines = filter_sysctl_settings(ctx, lines) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 47f2f2fc8f563..1b1d56d9609e8 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -2284,7 +2284,7 @@ Then run the following: if action == 'rotate-key': if d.daemon_type not in ['mgr', 'osd', 'mds', - 'rgw', 'crash', 'nfs', 'rbd-mirror', 'iscsi', 'nvmeof']: + 'rgw', 'crash', 'nfs', 'rbd-mirror', 'iscsi']: raise OrchestratorError( f'key rotation not supported for {d.daemon_type}' ) @@ -2662,8 +2662,6 @@ Then run the following: deps = [self.iscsi_service.get_trusted_ips(iscsi_spec)] else: deps = [self.get_mgr_ip()] - elif daemon_type == 'nvmeof': - deps = [] # TODO(redo) elif daemon_type == 'prometheus': # for prometheus we add the active mgr as an explicit dependency, # this way we force a redeploy after a mgr failover diff --git a/src/pybind/mgr/cephadm/services/nvmeof.py b/src/pybind/mgr/cephadm/services/nvmeof.py index 00db7e556019d..e3b684a225a93 100644 --- a/src/pybind/mgr/cephadm/services/nvmeof.py +++ b/src/pybind/mgr/cephadm/services/nvmeof.py @@ -1,5 +1,4 @@ import errno -import json import logging from typing import List, cast, Optional @@ -47,7 +46,7 @@ class NvmeofService(CephService): daemon_spec.keyring = keyring daemon_spec.extra_files = {'ceph-nvmeof.conf': gw_conf} daemon_spec.final_config, daemon_spec.deps = self.generate_config(daemon_spec) - daemon_spec.deps = [] # TODO: which gw parameters will require a reconfig? + daemon_spec.deps = [] return daemon_spec def config_dashboard(self, daemon_descrs: List[DaemonDescription]) -> None: @@ -79,25 +78,8 @@ class NvmeofService(CephService): Called after the daemon is removed. """ logger.debug(f'Post remove daemon {self.TYPE}.{daemon.daemon_id}') - # TODO: remove config for dashboard nvmeof gateways if any - # needed to know if we have ssl stuff for nvmeof in ceph config - nvmeof_config_dict = {} - ret, nvmeof_config, err = self.mgr.mon_command({ - 'prefix': 'config-key dump', - 'key': 'nvmeof', - }) - if nvmeof_config: - nvmeof_config_dict = json.loads(nvmeof_config) - - # remove nvmeof cert and key from ceph config - for nvmeof_key, value in nvmeof_config_dict.items(): - if f'nvmeof/client.{daemon.name()}/' in nvmeof_key: - ret, out, err = self.mgr.mon_command({ - 'prefix': 'config-key rm', - 'key': nvmeof_key, - }) - logger.info(f'{nvmeof_key} removed from ceph config') + # and any certificates being used for mTLS def purge(self, service_name: str) -> None: """Removes configuration