kwargs['check_status'] = False
return self.run_cluster_cmd(**kwargs).exitstatus
- # XXX: Setting "shell" to True for LocalCephManager.run_ceph_w(), doesn't
- # work with vstart_runner.py; see https://tracker.ceph.com/issues/49644.
- # shell=False as default parameter is just to maintain compatibility
- # between interfaces of CephManager.run_ceph_w() and
- # LocalCephManager.run_ceph_w(). This doesn't affect how "ceph -w" process
- # is launched by this method since this parameters remains unused in
- # this method.
- def run_ceph_w(self, watch_channel=None, shell=False):
+ def run_ceph_w(self, watch_channel=None):
"""
Execute "ceph -w" in the background with stdout connected to a BytesIO,
and return the RemoteProcess.
return found
def __enter__(self):
- # XXX: For reason behind setting "shell" to False, see
- # https://tracker.ceph.com/issues/49644.
- self.watcher_process = ceph_manager.run_ceph_w(watch_channel,
- shell=False)
+ self.watcher_process = ceph_manager.run_ceph_w(watch_channel)
def __exit__(self, exc_type, exc_val, exc_tb):
if not self.watcher_process.finished:
"""
return LocalRemote()
- # XXX: For reason behind setting "shell" to False, see
- # https://tracker.ceph.com/issues/49644.
- def run_ceph_w(self, watch_channel=None, shell=False):
+ def run_ceph_w(self, watch_channel=None):
"""
:param watch_channel: Specifies the channel to be watched.
This can be 'cluster', 'audit', ...
:type watch_channel: str
"""
- args = [CEPH_CMD, "-w"]
+ # XXX: Ceph API test CI job crashes because "ceph -w" process launched
+ # by run_ceph_w() crashes when shell is set to True.
+ # See https://tracker.ceph.com/issues/49644.
+ #
+ # The 2 possible workaround this are either setting "shell" to "False"
+ # when command "ceph -w" is executed or to prepend "exec sudo" to
+ # command arguments. We are going with latter since former would make
+ # it necessary to pass "shell" parameter to run() method. This leads
+ # to incompatibility with the method teuthology.orchestra.run's run()
+ # since it doesn't accept "shell" as parameter.
+ args = ['exec', 'sudo', CEPH_CMD, "-w"]
if watch_channel is not None:
args.append("--watch-channel")
args.append(watch_channel)
- proc = self.controller.run(args=args, wait=False, stdout=StringIO(),
- shell=shell)
+ proc = self.controller.run(args=args, wait=False, stdout=StringIO())
return proc
def run_cluster_cmd(self, **kwargs):