Skip to content

Commit 5a043fe

Browse files
committed
Addressing reviewers comments
Signed-off-by: Redouane Kachach <[email protected]>
1 parent 1dcbf61 commit 5a043fe

File tree

3 files changed

+8
-28
lines changed

3 files changed

+8
-28
lines changed

src/cephadm/cephadm.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,10 +1041,10 @@ def get_container_binds():
10411041

10421042
@staticmethod
10431043
def get_version(ctx: CephadmContext, container_id: str) -> Optional[str]:
1044-
out, err, ret = call_throws(ctx, [
1045-
ctx.container_engine.path, 'inspect',
1046-
'--format', '{{index .Config.Labels "io.ceph.version"}}',
1047-
ctx.image])
1044+
out, err, ret = call(ctx,
1045+
[ctx.container_engine.path, 'inspect',
1046+
'--format', '{{index .Config.Labels "io.ceph.version"}}',
1047+
ctx.image])
10481048
version = None
10491049
if ret == 0:
10501050
version = out.strip()
@@ -4111,7 +4111,7 @@ def _write(conf: Path, lines: List[str]) -> None:
41114111
lines = HAproxy.get_sysctl_settings()
41124112
elif daemon_type == 'keepalived':
41134113
lines = Keepalived.get_sysctl_settings()
4114-
elif daemon_type == 'nvmeof':
4114+
elif daemon_type == CephNvmeof.daemon_type:
41154115
lines = CephNvmeof.get_sysctl_settings()
41164116
lines = filter_sysctl_settings(ctx, lines)
41174117

src/pybind/mgr/cephadm/module.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2289,7 +2289,7 @@ def daemon_action(self, action: str, daemon_name: str, image: Optional[str] = No
22892289

22902290
if action == 'rotate-key':
22912291
if d.daemon_type not in ['mgr', 'osd', 'mds',
2292-
'rgw', 'crash', 'nfs', 'rbd-mirror', 'iscsi', 'nvmeof']:
2292+
'rgw', 'crash', 'nfs', 'rbd-mirror', 'iscsi']:
22932293
raise OrchestratorError(
22942294
f'key rotation not supported for {d.daemon_type}'
22952295
)
@@ -2664,8 +2664,6 @@ def get_daemon_names(daemons: List[str]) -> List[str]:
26642664
deps = [self.iscsi_service.get_trusted_ips(iscsi_spec)]
26652665
else:
26662666
deps = [self.get_mgr_ip()]
2667-
elif daemon_type == 'nvmeof':
2668-
deps = [] # TODO(redo)
26692667
elif daemon_type == 'prometheus':
26702668
# for prometheus we add the active mgr as an explicit dependency,
26712669
# this way we force a redeploy after a mgr failover

src/pybind/mgr/cephadm/services/nvmeof.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import errno
2-
import json
32
import logging
43
from typing import List, cast, Optional
54

@@ -47,7 +46,7 @@ def prepare_create(self, daemon_spec: CephadmDaemonDeploySpec) -> CephadmDaemonD
4746
daemon_spec.keyring = keyring
4847
daemon_spec.extra_files = {'ceph-nvmeof.conf': gw_conf}
4948
daemon_spec.final_config, daemon_spec.deps = self.generate_config(daemon_spec)
50-
daemon_spec.deps = [] # TODO: which gw parameters will require a reconfig?
49+
daemon_spec.deps = []
5150
return daemon_spec
5251

5352
def config_dashboard(self, daemon_descrs: List[DaemonDescription]) -> None:
@@ -79,25 +78,8 @@ def post_remove(self, daemon: DaemonDescription, is_failed_deploy: bool) -> None
7978
Called after the daemon is removed.
8079
"""
8180
logger.debug(f'Post remove daemon {self.TYPE}.{daemon.daemon_id}')
82-
8381
# TODO: remove config for dashboard nvmeof gateways if any
84-
# needed to know if we have ssl stuff for nvmeof in ceph config
85-
nvmeof_config_dict = {}
86-
ret, nvmeof_config, err = self.mgr.mon_command({
87-
'prefix': 'config-key dump',
88-
'key': 'nvmeof',
89-
})
90-
if nvmeof_config:
91-
nvmeof_config_dict = json.loads(nvmeof_config)
92-
93-
# remove nvmeof cert and key from ceph config
94-
for nvmeof_key, value in nvmeof_config_dict.items():
95-
if f'nvmeof/client.{daemon.name()}/' in nvmeof_key:
96-
ret, out, err = self.mgr.mon_command({
97-
'prefix': 'config-key rm',
98-
'key': nvmeof_key,
99-
})
100-
logger.info(f'{nvmeof_key} removed from ceph config')
82+
# and any certificates being used for mTLS
10183

10284
def purge(self, service_name: str) -> None:
10385
"""Removes configuration

0 commit comments

Comments
 (0)