]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/vstart_runner.py: make printing of stdout of ps optional
authorRishabh Dave <ridave@redhat.com>
Sat, 17 Aug 2019 07:42:38 +0000 (13:12 +0530)
committerRishabh Dave <ridave@redhat.com>
Wed, 25 Sep 2019 06:41:54 +0000 (12:11 +0530)
stdout of ps command is generally pretty huge which makes it harder to
interpret logs. Don't print it by default and add "--log-ps-output" to
enable printing it.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
doc/dev/developer_guide/index.rst
qa/tasks/vstart_runner.py

index e799801873ca0d0836c0edf035f4ad8abda714fc..8e2af11c045e886af45066851272fe6a400b9af0 100644 (file)
@@ -1636,6 +1636,7 @@ vstart_runner.py can take 3 options -
 --create-cluster-only       creates the cluster and quits; tests can be issued
                             later
 --interactive               drops a Python shell when a test fails
+--log-ps-output             logs ps output; might be useful while debugging
 --teardown                  tears Ceph cluster down after test(s) has finished
                             runnng
 
index 63f37bd7d202bb4844ed42f99d835a0e240d15c6..fcc09ad8feeb8b79c8bc3372fe8fb90b7ad0b8ac 100644 (file)
@@ -390,10 +390,13 @@ class LocalDaemon(object):
             if line.find("ceph-{0} -i {1}".format(self.daemon_type, self.daemon_id)) != -1:
                 log.info("Found ps line for daemon: {0}".format(line))
                 return int(line.split()[0])
-        log.info("No match for {0} {1}: {2}".format(
-            self.daemon_type, self.daemon_id, ps_txt
-            ))
-        return None
+        if log_ps_output:
+            log.info("No match for {0} {1}: {2}".format(
+                self.daemon_type, self.daemon_id, ps_txt))
+        else:
+            log.info("No match for {0} {1}".format(self.daemon_type,
+                     self.daemon_id))
+            return None
 
     def wait(self, timeout):
         waited = 0
@@ -999,6 +1002,8 @@ def exec_test():
     create_cluster_only = False
     ignore_missing_binaries = False
     teardown_cluster = False
+    global log_ps_output
+    log_ps_output = False
 
     args = sys.argv[1:]
     flags = [a for a in args if a.startswith("-")]
@@ -1014,6 +1019,8 @@ def exec_test():
             ignore_missing_binaries = True
         elif f == '--teardown':
             teardown_cluster = True
+        elif f == '--log-ps-output':
+            log_ps_output = True
         else:
             log.error("Unknown option '{0}'".format(f))
             sys.exit(-1)