xen-drbd

diff xen-drbd-install.py @ 10:c14b6387ada5

show usage fixed
author igor
date Tue Feb 12 13:41:24 2008 +0200 (2008-02-12)
parents e2eafd7e1b85
children f94023de662c
line diff
     1.1 --- a/xen-drbd-install.py	Tue Feb 12 13:34:12 2008 +0200
     1.2 +++ b/xen-drbd-install.py	Tue Feb 12 13:41:24 2008 +0200
     1.3 @@ -2,13 +2,29 @@
     1.4  
     1.5  import sys,re
     1.6  
     1.7 +def show_usage():
     1.8 +    print """
     1.9 +Usage:
    1.10 +    xen-drbd-install <network> <command>            (to view)
    1.11 +    xen-drbd-install <network> <command> | sh -s    (to run)
    1.12 +
    1.13 +    <network> is a name of the file, which contains network description
    1.14 +
    1.15 +Commands:
    1.16 +    make-drbd
    1.17 +    make-domains
    1.18 +    make-bridges
    1.19 +    make-links
    1.20 +"""
    1.21 +
    1.22 +if len(sys.argv) != 2:
    1.23 +    show_usage()
    1.24 +    sys.exit(1)
    1.25 +
    1.26 +
    1.27  network=sys.argv[1]
    1.28  try:
    1.29      exec 'from %s import * ' % (network)
    1.30 -#    exec 'from %s import domains,disk_table,lvm_vg_name,node1,node1_ip,node2,node2_ip, \
    1.31 -#        ip_network, domain_name, ip_nameserver, ip_gateway, apt_get_install, \
    1.32 -#        debian_release, debian_mirror, \
    1.33 -#        bridges, vlans, management_vlan, trunk, management_ip, management_gw ' % (network)
    1.34  except:
    1.35      print "Can't find or interpret module %s with topology description" %(network)
    1.36      sys.exit(1)
    1.37 @@ -314,20 +330,6 @@
    1.38              print "route add default gw %s" % (management_gw)
    1.39  
    1.40  
    1.41 -def show_usage():
    1.42 -    print """
    1.43 -Usage:
    1.44 -    xen-drbd-install <network> <command>            (to view)
    1.45 -    xen-drbd-install <network> <command> | sh -s    (to run)
    1.46 -
    1.47 -    <network> is a name of the file, which contains network description
    1.48 -
    1.49 -Commands:
    1.50 -    make-drbd
    1.51 -    make-domains
    1.52 -    make-bridges
    1.53 -    make-links
    1.54 -"""
    1.55  
    1.56  #make_all_system()
    1.57