xen-drbd
diff xen-drbd-install.py @ 38:30671fe7fd79
Now you can use 'domain' variable inside netowrk topology file
author | igor@manas.xt.vpn |
---|---|
date | Thu Sep 18 11:42:52 2008 +0300 (2008-09-18) |
parents | e80bdf496aa2 |
children | 263d00b75422 |
line diff
1.1 --- a/xen-drbd-install.py Mon Sep 15 10:03:24 2008 +0300 1.2 +++ b/xen-drbd-install.py Thu Sep 18 11:42:52 2008 +0300 1.3 @@ -28,8 +28,7 @@ 1.4 try: 1.5 opts, args = getopt.getopt(sys.argv[1:], "hn:", ["help", "network="]) 1.6 except getopt.GetoptError, err: 1.7 - # print help information and exit: 1.8 - print str(err) # will print something like "option -a not recognized" 1.9 + print str(err) 1.10 usage() 1.11 sys.exit(2) 1.12 1.13 @@ -47,10 +46,15 @@ 1.14 sys.exit(1) 1.15 1.16 try: 1.17 - exec 'from %s import * ' % (network) 1.18 -except ImportError: 1.19 - print "Can't find or interpret module <%s> with topology description" %(network) 1.20 - sys.exit(1) 1.21 + execfile(network) 1.22 +except IOError: 1.23 + print "Network configuration file <%s> not found " % network 1.24 + if network == 'network': 1.25 + print "You can use -n option to specify network filename" 1.26 + sys.exit(2) 1.27 +except NameError: 1.28 + domain=domains[0] 1.29 + execfile(network) 1.30 1.31 1.32 drbd_base_port=7790