Added a remctl script listuser which an admin can use remctl listuser $user and list...
[invirt/packages/invirt-remote.git] / server / usr / sbin / invirt-remote-lvm
1 #!/usr/bin/python
2
3 """
4 Run an LVM command on one host, with failover for downed hosts.
5 """
6
7 from invirt.remote import monocast
8 import sys
9 import os
10
11 def main(argv):
12     # Query each of the hosts.
13     if(os.path.exists("/etc/invirt/nolvm")):
14         sys.stderr.write("LVM operations are temporarily disabled for maintenance, sorry.\n")
15         return 2
16     result = monocast(argv[1:])
17     #print "Hostname: %s; down=%s" % (result[0], result[1])
18     sys.stdout.write(result[3]) # stdout
19     sys.stderr.write(result[4]) # stderr
20
21 if __name__ == '__main__':
22     sys.exit(main(sys.argv))
23
24 # vim:et:sw=4:ts=4