]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
downburst: always log output and error, check returncode for failure 1041/head
authorDan Mick <dan.mick@redhat.com>
Mon, 6 Mar 2017 23:41:36 +0000 (15:41 -0800)
committerDan Mick <dan.mick@redhat.com>
Mon, 6 Mar 2017 23:54:08 +0000 (15:54 -0800)
The more info the better; always log everything about the downburst
execution to the teuthology log.  Check for command failure by
checking for returncode != 0 rather than "presence of stderr", since
logging always happens to stderr.

Signed-off-by: Dan Mick <dan.mick@redhat.com>
teuthology/provision/downburst.py

index 514f38b65ef43ebf7061bb382fa096a60c74af5c..3517a0ee2b177d1d2444fc820800cbfa0f5bd3d8 100644 (file)
@@ -73,6 +73,8 @@ class Downburst(object):
                         action="downburst create") as proceed:
             while proceed():
                 (returncode, stdout, stderr) = self._run_create()
+                log.info(stdout)
+                log.info(stderr)
                 if returncode == 0:
                     log.info("Downburst created %s: %s" % (self.name,
                                                            stdout.strip()))
@@ -136,22 +138,19 @@ class Downburst(object):
         proc = subprocess.Popen(args, stdout=subprocess.PIPE,
                                 stderr=subprocess.PIPE,)
         out, err = proc.communicate()
-        if err:
+        log.info(out)
+        log.info(err)
+        if proc.returncode != 0:
             not_found_msg = "no domain with matching name '%s'" % self.shortname
             if not_found_msg in err:
                 log.warn("Ignoring error during destroy: %s", err)
                 return True
-            log.error("Error destroying {machine}: {msg}".format(
-                machine=self.name, msg=err))
+            log.error("Error destroying {machine}: {msg}".format(machine=self.name))
             return False
-        elif proc.returncode == 0:
+        else:
             out_str = ': %s' % out if out else ''
             log.info("Destroyed %s%s" % (self.name, out_str))
             return True
-        else:
-            log.error("I don't know if the destroy of {node} succeded!".format(
-                node=self.name))
-            return False
 
     def build_config(self):
         """