From: Sebastian Wagner Date: Fri, 11 Sep 2020 12:18:54 +0000 (+0200) Subject: mgr/cephadm: allow iscsi to be named by teuthology X-Git-Tag: wip-pdonnell-testing-20200918.022351~53^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1bd86d33166246d0b49997aabe6d146be2171c1a;p=ceph-ci.git mgr/cephadm: allow iscsi to be named by teuthology Signed-off-by: Sebastian Wagner --- diff --git a/src/pybind/mgr/cephadm/tests/test_spec.py b/src/pybind/mgr/cephadm/tests/test_spec.py index 55001f036d8..663e09a551d 100644 --- a/src/pybind/mgr/cephadm/tests/test_spec.py +++ b/src/pybind/mgr/cephadm/tests/test_spec.py @@ -531,6 +531,19 @@ def test_dd_octopus(dd_json): ), True ), + ( + # fixed daemon id for teuthology. + IscsiServiceSpec( + service_type='iscsi', + service_id='iscsi', + ), + DaemonDescription( + daemon_type='iscsi', + daemon_id="iscsi.a", + hostname="host1", + ), + True + ), ]) def test_daemon_description_service_name(spec: ServiceSpec, dd: DaemonDescription, diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py index ee32fd33013..117d3d0b3d6 100644 --- a/src/pybind/mgr/orchestrator/_interface.py +++ b/src/pybind/mgr/orchestrator/_interface.py @@ -1291,6 +1291,10 @@ class DaemonDescription(object): if len(v) in [3, 4]: return '.'.join(v[0:2]) + if self.daemon_type == 'iscsi': + v = self.daemon_id.split('.') + return '.'.join(v[0:-1]) + # daemon_id == "service_id" return self.daemon_id