# HG changeset patch # User igor # Date 1202816484 -7200 # Node ID c14b6387ada57788bd8f02dce440050be42e8139 # Parent e2eafd7e1b856cd2399a9c3923b706e6076b49c7 show usage fixed diff -r e2eafd7e1b85 -r c14b6387ada5 xen-drbd-install.py --- a/xen-drbd-install.py Tue Feb 12 13:34:12 2008 +0200 +++ b/xen-drbd-install.py Tue Feb 12 13:41:24 2008 +0200 @@ -2,13 +2,29 @@ import sys,re +def show_usage(): + print """ +Usage: + xen-drbd-install (to view) + xen-drbd-install | sh -s (to run) + + is a name of the file, which contains network description + +Commands: + make-drbd + make-domains + make-bridges + make-links +""" + +if len(sys.argv) != 2: + show_usage() + sys.exit(1) + + network=sys.argv[1] try: exec 'from %s import * ' % (network) -# exec 'from %s import domains,disk_table,lvm_vg_name,node1,node1_ip,node2,node2_ip, \ -# ip_network, domain_name, ip_nameserver, ip_gateway, apt_get_install, \ -# debian_release, debian_mirror, \ -# bridges, vlans, management_vlan, trunk, management_ip, management_gw ' % (network) except: print "Can't find or interpret module %s with topology description" %(network) sys.exit(1) @@ -314,20 +330,6 @@ print "route add default gw %s" % (management_gw) -def show_usage(): - print """ -Usage: - xen-drbd-install (to view) - xen-drbd-install | sh -s (to run) - - is a name of the file, which contains network description - -Commands: - make-drbd - make-domains - make-bridges - make-links -""" #make_all_system()