]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-daemon: raise RuntimeError when CephContainer.run() fails 31328/head
authorMichael Fritch <mfritch@suse.com>
Thu, 31 Oct 2019 19:04:39 +0000 (13:04 -0600)
committerMichael Fritch <mfritch@suse.com>
Mon, 4 Nov 2019 15:54:09 +0000 (08:54 -0700)
Signed-off-by: Michael Fritch <mfritch@suse.com>
src/ceph-daemon

index f2d4b4170135a9c86a9adcdc980606b65efee263..2e60ddd63cfa04ca48c77c2b637dda25514adb57 100755 (executable)
@@ -78,7 +78,7 @@ podman_path = None
 ##################################
 # Popen wrappers, lifted from ceph-volume
 
-def call(command, desc=None, verbose=False, **kw):
+def call(command, desc=None, verbose=False, **kwargs):
     """
     Wrap subprocess.Popen to
 
@@ -93,7 +93,7 @@ def call(command, desc=None, verbose=False, **kw):
     """
     if not desc:
         desc = command[0]
-    verbose_on_failure = kw.pop('verbose_on_failure', True)
+    verbose_on_failure = kwargs.pop('verbose_on_failure', True)
 
     logger.debug("Running command: %s" % ' '.join(command))
     process = subprocess.Popen(
@@ -101,7 +101,7 @@ def call(command, desc=None, verbose=False, **kw):
         stdout=subprocess.PIPE,
         stderr=subprocess.PIPE,
         close_fds=True,
-        **kw
+        **kwargs
     )
     # get current p.stdout flags, add O_NONBLOCK
     stdout_flags = fcntl.fcntl(process.stdout, fcntl.F_GETFL)
@@ -160,7 +160,7 @@ def call(command, desc=None, verbose=False, **kw):
     return out, err, returncode
 
 def call_throws(command, **kwargs):
-    out, err, ret = call(command, command[0], **kwargs)
+    out, err, ret = call(command, **kwargs)
     if ret:
         raise RuntimeError('Failed command: %s' % ' '.join(command))
     return out, err, ret
@@ -757,7 +757,7 @@ class CephContainer:
 
     def run(self):
         logger.debug(self.run_cmd())
-        out, _, _ = call(self.run_cmd(), self.entrypoint)
+        out, _, _ = call_throws(self.run_cmd(), desc=self.entrypoint)
         return out