From: Loic Dachary Date: Sat, 22 Nov 2014 13:51:56 +0000 (+0100) Subject: cluster: add owner argument to write_file X-Git-Tag: 1.1.0~1061^2~22^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9b70a17407d2290e8e99a97d27ce6347a30ac50c;p=teuthology.git cluster: add owner argument to write_file The misc.sudo_write_file now supports the optional owner argument, add support for it. Signed-off-by: Loic Dachary --- diff --git a/teuthology/orchestra/cluster.py b/teuthology/orchestra/cluster.py index 22490c3ecd..36febec9c4 100644 --- a/teuthology/orchestra/cluster.py +++ b/teuthology/orchestra/cluster.py @@ -63,7 +63,7 @@ class Cluster(object): remotes = sorted(self.remotes.iterkeys(), key=lambda rem: rem.name) return [remote.run(**kwargs) for remote in remotes] - def write_file(self, file_name, content, sudo=False, perms=None): + def write_file(self, file_name, content, sudo=False, perms=None, owner=None): """ Write text to a file on each node. @@ -75,10 +75,10 @@ class Cluster(object): remotes = sorted(self.remotes.iterkeys(), key=lambda rem: rem.name) for remote in remotes: if sudo: - teuthology.misc.sudo_write_file(remote, file_name, content, perms) + teuthology.misc.sudo_write_file(remote, file_name, content, perms=perms, owner=owner) else: - if perms is not None: - raise ValueError("To specify perms, sudo must be True") + if perms is not None or owner is not None: + raise ValueError("To specify perms or owner, sudo must be True") teuthology.misc.write_file(remote, file_name, content) def only(self, *roles):