From e6afe66b24845a4a9ccfd0a6f470569d6a7cc3b3 Mon Sep 17 00:00:00 2001 From: John Spray Date: Wed, 20 May 2015 14:15:36 +0100 Subject: [PATCH] tasks/cephfs: allow stdin for Filesystem.rados Useful for puts when injecting data to test corruption handling. Signed-off-by: John Spray --- tasks/cephfs/filesystem.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tasks/cephfs/filesystem.py b/tasks/cephfs/filesystem.py index 667c07120b60e..4f30858a03036 100644 --- a/tasks/cephfs/filesystem.py +++ b/tasks/cephfs/filesystem.py @@ -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() -- 2.39.5