X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-remote.git/blobdiff_plain/2508fff995e0468c599b8739228d8cea3e61a4fb..73ef973290945bd454e27cca6de4727445fc4436:/server/usr/sbin/invirt-remote-lvm diff --git a/server/usr/sbin/invirt-remote-lvm b/server/usr/sbin/invirt-remote-lvm new file mode 100755 index 0000000..1c69107 --- /dev/null +++ b/server/usr/sbin/invirt-remote-lvm @@ -0,0 +1,24 @@ +#!/usr/bin/python + +""" +Run an LVM command on one host, with failover for downed hosts. +""" + +from invirt.remote import monocast +import sys +import os + +def main(argv): + # Query each of the hosts. + if(os.path.exists("/etc/invirt/nolvm")): + sys.stderr.write("LVM operations are temporarily disabled for maintenance, sorry.\n") + return 2 + result = monocast(argv[1:]) + #print "Hostname: %s; down=%s" % (result[0], result[1]) + sys.stdout.write(result[3]) # stdout + sys.stderr.write(result[4]) # stderr + +if __name__ == '__main__': + sys.exit(main(sys.argv)) + +# vim:et:sw=4:ts=4