]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/tasks/vstart_runner: consolidate logging message in LocalDaemon
authorKefu Chai <kchai@redhat.com>
Mon, 12 Jul 2021 05:15:06 +0000 (13:15 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 12 Jul 2021 05:25:44 +0000 (13:25 +0800)
it's more readable if we have a single logging message when no matching
pid is found.

Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/tasks/vstart_runner.py

index b205d1f203f2893ef5e791f615750dcab98a2cfe..2b4700ccf868aa958ffc8724e0d07b527b8e4b91 100644 (file)
@@ -532,13 +532,11 @@ class LocalDaemon(object):
             if line.find("ceph-{0} -i {1}".format(self.daemon_type, self.daemon_id)) != -1:
                 log.debug("Found ps line for daemon: {0}".format(line))
                 return int(line.split()[0])
-        if opt_log_ps_output:
-            log.debug("No match for {0} {1}: {2}".format(
-                self.daemon_type, self.daemon_id, ps_txt))
-        else:
-            log.debug("No match for {0} {1}".format(self.daemon_type,
-                     self.daemon_id))
-            return None
+        if not opt_log_ps_output:
+            ps_txt = '(omitted)'
+        log.debug("No match for {0} {1}: {2}".format(
+            self.daemon_type, self.daemon_id, ps_txt))
+        return None
 
     def wait(self, timeout):
         waited = 0