Skip to content

Commit

Permalink
orchestra/cluster: add sh() method
Browse files Browse the repository at this point in the history
For simplified outputs processing it might be usefull
to have a function will return all captured log from
all remote hosts in the given sequence.

Signed-off-by: Kyr Shatskyy <[email protected]>
  • Loading branch information
Kyr Shatskyy committed Mar 12, 2020
1 parent 1def34b commit 5c00b0c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions teuthology/orchestra/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ def run(self, **kwargs):
remotes = sorted(self.remotes.keys(), key=lambda rem: rem.name)
return [remote.run(**kwargs) for remote in remotes]

def sh(self, **kwargs):
"""
Run a command on all the nodes in this cluster.
Goes through nodes in alphabetical order.
Returns a list of the command outputs correspondingly.
"""
remotes = sorted(self.remotes.keys(), key=lambda rem: rem.name)
return [remote.sh(**kwargs) for remote in remotes]

def write_file(self, file_name, content, sudo=False, perms=None, owner=None):
"""
Write text to a file on each node.
Expand Down

0 comments on commit 5c00b0c

Please sign in to comment.