]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Thrashosds: Turn off output when doing dump_ops testing
authorDavid Zafman <dzafman@redhat.com>
Thu, 11 Aug 2016 04:15:05 +0000 (21:15 -0700)
committerDavid Zafman <dzafman@redhat.com>
Thu, 18 Aug 2016 16:02:14 +0000 (09:02 -0700)
Needed to add stdout option to pass down to run()

Signed-off-by: David Zafman <dzafman@redhat.com>
tasks/ceph_manager.py

index ea0ccacd3a3b80a59666786d29a2886e05730e7f..c2c5fb7a27bbbe6caf1781269884010bd1890b4a 100644 (file)
@@ -22,6 +22,10 @@ from teuthology.orchestra.remote import Remote
 from teuthology.orchestra import run
 from teuthology.exceptions import CommandFailedError
 
+try:
+    from subprocess import DEVNULL # py3k
+except ImportError:
+    DEVNULL = open(os.devnull, 'r+')
 
 DEFAULT_CONF_PATH = '/etc/ceph/ceph.conf'
 
@@ -727,11 +731,11 @@ class Thrasher:
             for osd in self.live_osds:
                 # Ignore errors because live_osds is in flux
                 self.ceph_manager.osd_admin_socket(osd, command=['dump_ops_in_flight'],
-                                     check_status=False, timeout=30)
+                                     check_status=False, timeout=30, stdout=DEVNULL)
                 self.ceph_manager.osd_admin_socket(osd, command=['dump_blocked_ops'],
-                                     check_status=False, timeout=30)
+                                     check_status=False, timeout=30, stdout=DEVNULL)
                 self.ceph_manager.osd_admin_socket(osd, command=['dump_historic_ops'],
-                                     check_status=False, timeout=30)
+                                     check_status=False, timeout=30, stdout=DEVNULL)
             gevent.sleep(0)
 
     @log_exc
@@ -844,14 +848,14 @@ class ObjectStoreTool:
         lines.append(cmd)
         return "\n".join(lines)
 
-    def run(self, options, args, stdin=None):
+    def run(self, options, args, stdin=None, stdout=StringIO()):
         self.manager.kill_osd(self.osd)
         cmd = self.build_cmd(options, args, stdin)
         self.manager.log(cmd)
         try:
             proc = self.remote.run(args=['bash', '-e', '-x', '-c', cmd],
                                    check_status=False,
-                                   stdout=StringIO(),
+                                   stdout=stdout,
                                    stderr=StringIO())
             proc.wait()
             if proc.exitstatus != 0:
@@ -1051,8 +1055,8 @@ class CephManager:
             check_status=False
         ).exitstatus
 
-    def osd_admin_socket(self, osd_id, command, check_status=True, timeout=0):
-        return self.admin_socket('osd', osd_id, command, check_status, timeout)
+    def osd_admin_socket(self, osd_id, command, check_status=True, timeout=0, stdout=StringIO()):
+        return self.admin_socket('osd', osd_id, command, check_status, timeout, stdout)
 
     def find_remote(self, service_type, service_id):
         """
@@ -1068,7 +1072,7 @@ class CephManager:
                           service_type, service_id)
 
     def admin_socket(self, service_type, service_id,
-                     command, check_status=True, timeout=0):
+                     command, check_status=True, timeout=0, stdout=StringIO()):
         """
         Remotely start up ceph specifying the admin socket
         :param command: a list of words to use as the command
@@ -1095,7 +1099,7 @@ class CephManager:
         args.extend(command)
         return remote.run(
             args=args,
-            stdout=StringIO(),
+            stdout=stdout,
             wait=True,
             check_status=check_status
             )