From: Sebastian Wagner Date: Tue, 19 May 2020 13:28:03 +0000 (+0200) Subject: mgr/orch: allow RGWs with explicit naming X-Git-Tag: v15.2.4~69^2~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fbdd13aa015f3ff32fd68ae80bf415d5f2666239;p=ceph.git mgr/orch: allow RGWs with explicit naming Signed-off-by: Sebastian Wagner (cherry picked from commit 3c3a97eaaa9d3939209abe492d1bc7c5ff0f26a8) --- diff --git a/src/pybind/mgr/cephadm/tests/test_spec.py b/src/pybind/mgr/cephadm/tests/test_spec.py index 530dae1fb5a2..a15e327e17e3 100644 --- a/src/pybind/mgr/cephadm/tests/test_spec.py +++ b/src/pybind/mgr/cephadm/tests/test_spec.py @@ -267,6 +267,19 @@ def test_spec_octopus(): ), True ), + ( + # explicit naming + RGWSpec( + rgw_realm="realm", + rgw_zone="zone", + ), + DaemonDescription( + daemon_type='rgw', + daemon_id="realm.zone.a", + hostname="smithi028", + ), + True + ), ( # without host RGWSpec( diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py index 6b0866042aae..471529b8350f 100644 --- a/src/pybind/mgr/orchestrator/_interface.py +++ b/src/pybind/mgr/orchestrator/_interface.py @@ -1314,6 +1314,11 @@ class DaemonDescription(object): if m: return m.group(1) + if self.daemon_type == 'rgw': + v = self.daemon_id.split('.') + if len(v) in [3, 4]: + return '.'.join(v[0:2]) + raise OrchestratorError("DaemonDescription: Cannot calculate service_id: " \ f"daemon_id='{self.daemon_id}' hostname='{self.hostname}'")