xentaur

diff xentaur.py @ 65:cf823d27b029

Nattaur changes
author nata@nattaur
date Mon Oct 12 00:12:11 2009 +0300 (2009-10-12)
parents 07c6777758dc
children aaf034af3a35
line diff
     1.1 --- a/xentaur.py	Fri Feb 29 07:22:46 2008 +0200
     1.2 +++ b/xentaur.py	Mon Oct 12 00:12:11 2009 +0300
     1.3 @@ -3,19 +3,18 @@
     1.4  
     1.5  import sys,os,time
     1.6  
     1.7 -xentaur_path=os.environ['HOME']+"/xentaur"
     1.8 +xentaur_path="/xentaur/xentaur"
     1.9  
    1.10  sys.path.append('/etc/xen')
    1.11  sys.path.append(xentaur_path)
    1.12  sys.path.append('.')
    1.13  
    1.14 -#network='snrs_ipsec_rsa_1'
    1.15  node_object={}
    1.16  link_object={}
    1.17  bridge_object={}
    1.18  
    1.19 -network='openvpnbridge'
    1.20 -domain='debian1'
    1.21 +network='multicast'
    1.22 +domain='dyn1'
    1.23  
    1.24  #network='snrs'
    1.25  #domain='dyn1'
    1.26 @@ -26,8 +25,8 @@
    1.27  from IPython.Shell import IPShellEmbed
    1.28  
    1.29  
    1.30 -screenrc=os.environ['HOME']+"/.screenrc_xentaur"
    1.31 -path_shapes='/xen/xentaur/shapes'
    1.32 +screenrc=".screenrc_xentaur_"+network
    1.33 +path_shapes='/xentaur/xentaur/shapes'
    1.34  
    1.35  def run(program, *args):
    1.36      pid = os.fork()
    1.37 @@ -178,10 +177,9 @@
    1.38  hardstatus alwayslastline
    1.39  %s
    1.40  
    1.41 -screen -t console 0 sh -c 'while true; do cd %s; ./xentaur.py shell ; echo Retrying in %s secods...; sleep %s ; clear; done'
    1.42 -#screen -t xentaur - sh -c 'while true; do bash ; echo Retrying in %s secods...; sleep %s ; clear; done'
    1.43 +screen -t console 0 sh -c 'while true; do %s/xentaur.py shell ; echo Retrying in %s secods...; sleep %s ; clear; done'
    1.44  %s
    1.45 -""" % (hardstatus,xentaur_path,wait_seconds,wait_seconds,wait_seconds,wait_seconds,screenlist))
    1.46 +""" % (hardstatus,xentaur_path,wait_seconds,wait_seconds,screenlist))
    1.47      f.close()
    1.48      print "# GNU Screen config file is written to: %s" % screenrc
    1.49  
    1.50 @@ -366,7 +364,7 @@
    1.51          return self.name+" [color=white,shape=plaintext,label=\"  "+self.name+"\",shapefile=\""+path_shapes+"/all/"+\
    1.52          domain_types[domains.index(self.name)]+".png\",fontcolor=black,fontsize=16,target=\"http://google.com\"]"
    1.53      def console_string(self):
    1.54 -        if self.type in [ 'quagga', 'xenomips', 'freebsd', 'linux' ]:
    1.55 +        if self.type in [ 'quagga', 'dynamips', 'freebsd', 'linux' ]:
    1.56              return "sudo xm console "+self.name
    1.57          elif self.name in real_bridges or self.name in real_nodes:
    1.58              return "echo Press enter to connect; read line; "+connection_table[self.name]