X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-remote.git/blobdiff_plain/2176cbdb63ce8467dcb5282f7f59a14e5d6154b3..443cfe1c276e956cb1643d0ebff86d63436256d1:/files/usr/sbin/sipb-xen-remote-control diff --git a/files/usr/sbin/sipb-xen-remote-control b/files/usr/sbin/sipb-xen-remote-control index 1ad8721..e61cb72 100755 --- a/files/usr/sbin/sipb-xen-remote-control +++ b/files/usr/sbin/sipb-xen-remote-control @@ -23,10 +23,18 @@ def main(argv): if machine_name not in vms: print >>sys.stderr, "machine '%s' is not on" % machine_name - return 2 + return 1 host = vms[machine_name]['host'] - return call(['remctl', host, 'remote', 'control'] + argv[1:]) + p = Popen(['remctl', host, 'remote', 'control'] + argv[1:], + stdout=PIPE, stderr=PIPE) + (out, err) = p.communicate() + if p.returncode == 1: + print >>sys.stderr, "machine '%s' is not on" % machine_name + return 1 + sys.stderr.write(err) + sys.stdout.write(out) + return p.returncode if __name__ == '__main__': sys.exit(main(sys.argv))