From cab89b2aa8b60443ae8f353f7ea027ce73a7a887 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Fri, 20 Mar 2020 12:03:36 +0100 Subject: [PATCH] python-common: reorder RGWSpec arguments to match the argumens from `ServiceSpec` Signed-off-by: Sebastian Wagner (cherry picked from commit 9335b7e5647b6afafdcdfe30c8023fc1e7655a34) --- src/pybind/mgr/cephadm/tests/test_cephadm.py | 6 +++--- src/python-common/ceph/deployment/service_spec.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pybind/mgr/cephadm/tests/test_cephadm.py b/src/pybind/mgr/cephadm/tests/test_cephadm.py index f6bbad9d2bc39..b34448479c479 100644 --- a/src/pybind/mgr/cephadm/tests/test_cephadm.py +++ b/src/pybind/mgr/cephadm/tests/test_cephadm.py @@ -243,7 +243,7 @@ class TestCephadm(object): with self._with_host(cephadm_module, 'test'): ps = PlacementSpec(hosts=['test'], count=1) - c = cephadm_module.add_rgw(RGWSpec('realm', 'zone', placement=ps)) + c = cephadm_module.add_rgw(RGWSpec(rgw_realm='realm', rgw_zone='zone', placement=ps)) [out] = wait(cephadm_module, c) match_glob(out, "Deployed rgw.realm.zone.* on host 'test'") @@ -253,12 +253,12 @@ class TestCephadm(object): with self._with_host(cephadm_module, 'host1'): with self._with_host(cephadm_module, 'host2'): ps = PlacementSpec(hosts=['host1'], count=1) - c = cephadm_module.add_rgw(RGWSpec('realm', 'zone1', placement=ps)) + c = cephadm_module.add_rgw(RGWSpec(rgw_realm='realm', rgw_zone='zone1', placement=ps)) [out] = wait(cephadm_module, c) match_glob(out, "Deployed rgw.realm.zone1.host1.* on host 'host1'") ps = PlacementSpec(hosts=['host1', 'host2'], count=2) - r = cephadm_module._apply_service(RGWSpec('realm', 'zone1', placement=ps)) + r = cephadm_module._apply_service(RGWSpec(rgw_realm='realm', rgw_zone='zone1', placement=ps)) assert r @mock.patch("cephadm.module.CephadmOrchestrator._run_cephadm", _run_cephadm( diff --git a/src/python-common/ceph/deployment/service_spec.py b/src/python-common/ceph/deployment/service_spec.py index 8266c310730a8..5f1251d5a2e11 100644 --- a/src/python-common/ceph/deployment/service_spec.py +++ b/src/python-common/ceph/deployment/service_spec.py @@ -462,17 +462,17 @@ class RGWSpec(ServiceSpec): """ def __init__(self, + service_type='rgw', + service_id=None, # type: Optional[str] + placement=None, rgw_realm=None, # type: Optional[str] rgw_zone=None, # type: Optional[str] subcluster=None, # type: Optional[str] - service_id=None, # type: Optional[str] - placement=None, - service_type='rgw', rgw_frontend_port=None, # type: Optional[int] unmanaged=False, # type: bool ssl=False, # type: bool ): - assert service_type == 'rgw' + assert service_type == 'rgw', service_type if service_id: a = service_id.split('.', 2) rgw_realm = a[0] -- 2.39.5