]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
python-common: continue to allow RGWSpec(realm=r,zone=z)
authorSage Weil <sage@newdream.net>
Mon, 8 Mar 2021 14:49:14 +0000 (09:49 -0500)
committerSage Weil <sage@newdream.net>
Tue, 16 Mar 2021 12:56:18 +0000 (07:56 -0500)
This is for backward compatibility: an octopus spec yaml can still be
applied to an existing cluster.  Note that it might not work on a new
cluster, since cephadm no longer tries to create the realm or zone if
they don't exist.

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit cca7391f54b724730ea091669627731bc74f3519)

src/pybind/mgr/cephadm/tests/test_cephadm.py
src/python-common/ceph/deployment/service_spec.py

index 8db49b269ba1a2749309e6d247fb2b62e47e0e20..9c1a7b7db07c328bef7a79ec96358c6d35cdd05a 100644 (file)
@@ -702,6 +702,7 @@ class TestCephadm(object):
             (ServiceSpec('alertmanager'), CephadmOrchestrator.add_alertmanager),
             (ServiceSpec('rbd-mirror'), CephadmOrchestrator.add_rbd_mirror),
             (ServiceSpec('mds', service_id='fsname'), CephadmOrchestrator.add_mds),
+            (RGWSpec(rgw_realm='realm', rgw_zone='zone'), CephadmOrchestrator.add_rgw),
             (RGWSpec(service_id="foo"), CephadmOrchestrator.add_rgw),
             (ServiceSpec('cephadm-exporter'), CephadmOrchestrator.add_cephadm_exporter),
         ]
index d619bb547895990f8399659f64f2c31083d399a3..bc54a7fd51b9f15ac449354419eaaaa563b7c2a6 100644 (file)
@@ -667,6 +667,11 @@ class RGWSpec(ServiceSpec):
                  subcluster: Optional[str] = None,  # legacy, only for from_json on upgrade
                  ):
         assert service_type == 'rgw', service_type
+
+        # for backward compatibility with octopus spec files,
+        if not service_id and (rgw_realm and rgw_zone):
+            service_id = rgw_realm + '.' + rgw_zone
+
         super(RGWSpec, self).__init__(
             'rgw', service_id=service_id,
             placement=placement, unmanaged=unmanaged,