X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-base.git/blobdiff_plain/cb5ceb33ff4e87e35e30cffb07c2dec47fa5937e..f2acfa0565a11ed251ad390461a5c428640681c2:/files/usr/share/python-support/sipb-xen-base/invirt/remote.py diff --git a/files/usr/share/python-support/sipb-xen-base/invirt/remote.py b/files/usr/share/python-support/sipb-xen-base/invirt/remote.py deleted file mode 100644 index 0d7dba2..0000000 --- a/files/usr/share/python-support/sipb-xen-base/invirt/remote.py +++ /dev/null @@ -1,19 +0,0 @@ -from subprocess import PIPE, Popen -from invirt.config import structs as config -import yaml - -def bcast(cmd, hosts = [h.hostname for h in config.hosts]): - """ - Given a command and a list of hostnames or IPs, issue the command to all - the nodes and return a list of (host, output) pairs (the order should be - the same as the order of the hosts). - """ - pipes = [(host, - Popen(['remctl', host, 'remote', 'web', cmd], stdout=PIPE)) - for host in hosts] - outputs = [(s, p.communicate()[0]) for (s, p) in pipes] - for (s, p) in pipes: - if p.returncode != 0: - raise RuntimeError("remctl to host %s returned non-zero exit status %d" - % (s, p.returncode)) - return [(s, yaml.load(o, yaml.CSafeLoader)) for (s, o) in outputs]