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 """
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 """