]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Fixing output of create zone when several spec zones are provided
authorRedouane Kachach <rkachach@redhat.com>
Tue, 11 Oct 2022 14:53:02 +0000 (16:53 +0200)
committerRedouane Kachach <rkachach@redhat.com>
Tue, 11 Oct 2022 14:53:02 +0000 (16:53 +0200)
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
src/pybind/mgr/rgw/module.py
src/python-common/ceph/rgw/rgwam_core.py

index 2b08151aa88fecf3b86786c662cc0819e5841f9f..1595f791b18a5ddba31e9ebb93575bfc2646d6aa 100644 (file)
@@ -277,15 +277,15 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
             return HandleCommandResult(retval=-errno.EINVAL, stdout='', stderr=err_msg)
 
         try:
+            created_zones = []
             for rgw_spec in rgw_specs:
-                retval, out, err = RGWAM(self.env).zone_create(rgw_spec, start_radosgw)
-                if retval != 0:
-                    break
+                RGWAM(self.env).zone_create(rgw_spec, start_radosgw)
+                created_zones.append(rgw_spec.rgw_zone)
         except RGWAMException as e:
             self.log.error('cmd run exception: (%d) %s' % (e.retcode, e.message))
             return HandleCommandResult(retval=e.retcode, stdout=e.stdout, stderr=e.stderr)
 
-        return HandleCommandResult(retval=retval, stdout=out, stderr=err)
+        return HandleCommandResult(retval=0, stdout=f"Zones {', '.join(created_zones)} created successfully")
 
     @CLICommand('rgw realm reconcile', perm='rw')
     def _cmd_rgw_realm_reconcile(self,
index c19deaf0c105470b226a44c2e40c579e4e6f6b05..e7c09b590b352d15e79d7aa4e8244818fcb531c2 100644 (file)
@@ -795,8 +795,6 @@ class RGWAM:
             rgw_spec.rgw_token = realm_token_s
             self.env.mgr.apply_rgw(rgw_spec)
 
-        return (0, f'Created zone {zone.name} {zone.id}', '')
-
     def _get_daemon_eps(self, realm_name=None, zonegroup_name=None, zone_name=None):
         # get running daemons info
         service_name = None