]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/rgw: don't duplicate 'user list' commands for default zone
authorCasey Bodley <cbodley@redhat.com>
Mon, 23 Mar 2026 14:34:38 +0000 (10:34 -0400)
committerCasey Bodley <cbodley@redhat.com>
Mon, 20 Apr 2026 16:41:03 +0000 (12:41 -0400)
some commands during setup expect the zone to exist already, so run
'radosgw-admin user list' to make sure a default zone/zonegroup are
created. avoid duplicating this in several subtasks by moving this to
its own subtask that runs when a realm is not configured

Signed-off-by: Casey Bodley <cbodley@redhat.com>
qa/tasks/rgw.py

index b6cce36b64b244eb04b9bb1301bda342a95c88c7..292b05efbd790674b5b27bb962bdbe034e704a7c 100644 (file)
@@ -337,6 +337,14 @@ def create_realm(ctx, clients):
                  check_status=True)
     yield
 
+@contextlib.contextmanager
+def init_default_zone(ctx, clients):
+    for client in clients:
+        # XXX: the 'default' zone and zonegroup aren't created until we run RGWRados::init_complete().
+        # issue a 'radosgw-admin user list' command to trigger this
+        rgwadmin(ctx, client, cmd=['user', 'list'])
+    yield
+
 @contextlib.contextmanager
 def create_pools(ctx, clients):
     """Create replicated or erasure coded data pools for rgw."""
@@ -368,11 +376,6 @@ def configure_compression(ctx, clients, compression):
     """ set a compression type in the default zone placement """
     log.info('Configuring compression type = %s', compression)
     for client in clients:
-        if not ctx.rgw.realm:
-            # XXX: the 'default' zone and zonegroup aren't created until we run RGWRados::init_complete().
-            # issue a 'radosgw-admin user list' command to trigger this
-            rgwadmin(ctx, client, cmd=['user', 'list'], check_status=True)
-
         rgwadmin(ctx, client,
                 cmd=['zone', 'placement', 'modify', '--rgw-zone', ctx.rgw.zone,
                      '--placement-id', 'default-placement',
@@ -383,11 +386,6 @@ def configure_compression(ctx, clients, compression):
 @contextlib.contextmanager
 def disable_inline_data(ctx, clients):
     for client in clients:
-        if not ctx.rgw.realm:
-            # XXX: the 'default' zone and zonegroup aren't created until we run RGWRados::init_complete().
-            # issue a 'radosgw-admin user list' command to trigger this
-            rgwadmin(ctx, client, cmd=['user', 'list'], check_status=True)
-
         rgwadmin(ctx, client,
                 cmd=['zone', 'placement', 'modify', '--rgw-zone', ctx.rgw.zone,
                      '--placement-id', 'default-placement',
@@ -411,11 +409,6 @@ def configure_datacache(ctx, clients, datacache_path):
 def configure_storage_classes(ctx, clients, storage_classes):
     """ create additional storage classes in the default zone placement """
     for client in clients:
-        if not ctx.rgw.realm:
-            # XXX: the 'default' zone and zonegroup aren't created until we run RGWRados::init_complete().
-            # issue a 'radosgw-admin user list' command to trigger this
-            rgwadmin(ctx, client, cmd=['user', 'list'], check_status=True)
-
         for name, args in storage_classes.items():
             log.info('Configuring storage class = %s', name)
             rgwadmin(ctx, client,
@@ -526,6 +519,10 @@ def task(ctx, config):
         subtasks.extend([
             lambda: create_realm(ctx=ctx, clients=clients),
         ])
+    else:
+        subtasks.extend([
+            lambda: init_default_zone(ctx=ctx, clients=clients)
+        ])
     if ctx.rgw.compression_type:
         subtasks.extend([
             lambda: configure_compression(ctx=ctx, clients=clients,