]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/cephfs: allow stdin for Filesystem.rados
authorJohn Spray <jspray@redhat.com>
Wed, 20 May 2015 13:15:36 +0000 (14:15 +0100)
committerJohn Spray <jspray@redhat.com>
Wed, 17 Jun 2015 13:06:23 +0000 (14:06 +0100)
Useful for puts when injecting data to test
corruption handling.

Signed-off-by: John Spray <john.spray@redhat.com>
tasks/cephfs/filesystem.py

index 667c07120b60e77170f4bced2eb6c42913555d17..4f30858a030361770a042a88d70a330b0632e2f1 100644 (file)
@@ -574,7 +574,7 @@ class Filesystem(object):
             log.info("All objects for ino {0} size {1} are absent".format(ino, size))
             return True
 
-    def rados(self, args, pool=None):
+    def rados(self, args, pool=None, stdin_data=None):
         """
         Call into the `rados` CLI from an MDS
         """
@@ -582,6 +582,9 @@ class Filesystem(object):
         if pool is None:
             pool = self.get_metadata_pool_name()
 
+        if stdin_data is None:
+            stdin_data = StringIO()
+
         # Doesn't matter which MDS we use to run rados commands, they all
         # have access to the pools
         mds_id = self.mds_ids[0]
@@ -592,6 +595,7 @@ class Filesystem(object):
         args = ["rados", "-p", pool] + args
         p = remote.run(
             args=args,
+            stdin=stdin_data,
             stdout=StringIO())
         return p.stdout.getvalue().strip()