source: trunk/packages/invirt-remote/server/usr/sbin/invirt-remote-lvm @ 2719

Last change on this file since 2719 was 2513, checked in by adehnert, 15 years ago

Minor cleanup of monocast and LVM load balancer

  • Property svn:executable set to *
File size: 596 bytes
RevLine 
[2495]1#!/usr/bin/python
2
3"""
4Run an LVM command on one host, with failover for downed hosts.
5"""
6
7from invirt.remote import monocast
8import sys
9import os
10
11def 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
[2513]20    return 0
[2495]21
22if __name__ == '__main__':
23    sys.exit(main(sys.argv))
Note: See TracBrowser for help on using the repository browser.