# HG changeset patch # User igor # Date 1203418425 -7200 # Node ID 6e01df357a6a4d47ed28e202e3aa8202d8450726 # Parent 2ecda36e8d0d764af3b29cd10386ca57b0f8d824 automatic hostname in topology diff -r 2ecda36e8d0d -r 6e01df357a6a od.py --- a/od.py Sun Feb 17 13:32:01 2008 +0200 +++ b/od.py Tue Feb 19 12:53:45 2008 +0200 @@ -1,7 +1,11 @@ node1='debian' node2='mirror' -i_am=node1 +#i_am=node1 + +from socket import gethostname; i_am=gethostname() +if i_am != node1 and i_am != node2: + raise ValueError, "My hostname (%s) should be equal to node1 (%s) or node2 (%s)" % (i_am, node1, node2) ip_address = { node1: '10.0.5.220', diff -r 2ecda36e8d0d -r 6e01df357a6a xen-drbd-install.py --- a/xen-drbd-install.py Sun Feb 17 13:32:01 2008 +0200 +++ b/xen-drbd-install.py Tue Feb 19 12:53:45 2008 +0200 @@ -26,7 +26,7 @@ network=sys.argv[1] try: exec 'from %s import * ' % (network) -except: +except ImportError: print "Can't find or interpret module %s with topology description" %(network) sys.exit(1) diff -r 2ecda36e8d0d -r 6e01df357a6a xen-drbd.py --- a/xen-drbd.py Sun Feb 17 13:32:01 2008 +0200 +++ b/xen-drbd.py Tue Feb 19 12:53:45 2008 +0200 @@ -1,6 +1,6 @@ #!/usr/bin/python -network='eb' +network='od' import sys,os,imp from commands import mkarg @@ -9,7 +9,7 @@ sys.path.append('/etc/xen') try: exec 'from %s import *' % (network) -except: +except ImportError: print "Can't find or interpret module %s with topology description" %(network) sys.exit(1)