]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/orch: allow RGWs with explicit naming
authorSebastian Wagner <sebastian.wagner@suse.com>
Tue, 19 May 2020 13:28:03 +0000 (15:28 +0200)
committerMichael Fritch <mfritch@suse.com>
Wed, 20 May 2020 00:59:38 +0000 (18:59 -0600)
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
src/pybind/mgr/cephadm/tests/test_spec.py
src/pybind/mgr/orchestrator/_interface.py

index 530dae1fb5a2be8841cb83976b6242f9d09f737f..a15e327e17e35dddc3281c183b27063b538faa71 100644 (file)
@@ -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(
index 6b0866042aae888e08122daaf7a959318f2aad3e..471529b8350f763d4dba66f908963aa8d912f5fc 100644 (file)
@@ -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}'")