]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
test/qa: fix admin cmd wip-shilpa-testing-main
authorShilpa Jagannath <smanjara@redhat.com>
Mon, 15 Dec 2025 18:27:37 +0000 (13:27 -0500)
committerShilpa Jagannath <smanjara@redhat.com>
Mon, 15 Dec 2025 18:27:37 +0000 (13:27 -0500)
Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
qa/tasks/rgw_multisite.py
src/test/rgw/rgw_multi/multisite.py

index f93ca017fa2d4d3b7c1f6e390349e9b394c080d7..4d6b421a97600a5d153e313ade3f143da4f8d822 100644 (file)
@@ -199,6 +199,27 @@ class Cluster(multisite.Cluster):
         if check_retcode:
             assert r == 0
         return s, r
+    
+    def ceph_admin(self, args = None, **kwargs):
+        """ ceph command """
+        args = args or []
+        # Build the ceph command with cluster specification
+        cmd = ['ceph', '--cluster', self.name] + args
+        
+        # Get the remote for this client
+        (remote,) = self.ctx.cluster.only(self.client).remotes.keys()
+        
+        # Run the command
+        check_retcode = kwargs.pop('check_retcode', True)
+        proc = remote.run(
+            args=cmd,
+            check_status=check_retcode,
+            **kwargs
+        )
+        
+        if hasattr(proc, 'stdout'):
+            return proc.stdout.getvalue() if hasattr(proc.stdout, 'getvalue') else proc.stdout
+        return ''
 
 class Gateway(multisite.Gateway):
     """ Controls a radosgw instance using its daemon """
index 982ebe3ea7d8d483354365369f5bfc95cb7c1697..6deb895657e03e1758e47a9f7f381dae74f4fd45 100644 (file)
@@ -13,6 +13,11 @@ class Cluster:
     def admin(self, args = None, **kwargs):
         """ execute a radosgw-admin command """
         pass
+    
+    @abstractmethod
+    def ceph_admin(self, args = None, **kwargs):
+        """ execute a ceph command """
+        pass
 
 class Gateway:
     """ interface to control a single radosgw instance """