xentaur

diff xentaur.py @ 35:244f1602496a

config splitted to several modules
author igor
date Tue Sep 25 22:16:24 2007 +0300 (2007-09-25)
parents c68d804c3017
children 7bf7abe92123
line diff
     1.1 --- a/xentaur.py	Sat Sep 22 02:25:18 2007 +0300
     1.2 +++ b/xentaur.py	Tue Sep 25 22:16:24 2007 +0300
     1.3 @@ -4,14 +4,21 @@
     1.4  import sys,os,time
     1.5  import xenomips_vars
     1.6  xenomips_vars.N='1'
     1.7 +
     1.8 +xentaur_path=os.environ['HOME']+"/xentaur"
     1.9 +
    1.10  sys.path.append('/etc/xen')
    1.11 +sys.path.append(xentaur_path)
    1.12  
    1.13 -xen_config_name='four_quaggasN'
    1.14 -try:
    1.15 -    exec 'from '+xen_config_name+' import bridges,vbridges_table, hidden_bridges, domains, broken_links, temporary_links, domain_types'
    1.16 -except:
    1.17 -    print "Can't find module: %s " % (xen_config_name)
    1.18 -    sys.exit(0)
    1.19 +network='faberge'
    1.20 +domain='dyn1'
    1.21 +from xendomain import *
    1.22 +
    1.23 +#try:
    1.24 +#    exec 'from '+network+' import bridges,vbridges_table, hidden_bridges, domains, broken_links, temporary_links, domain_types'
    1.25 +#except:
    1.26 +#    print "Can't find module: %s " % (xen_config_name)
    1.27 +#    sys.exit(0)
    1.28  
    1.29  bridges_turned_down=[]
    1.30  
    1.31 @@ -49,12 +56,12 @@
    1.32  
    1.33  
    1.34  def create_domains_script():
    1.35 -    for N in range(len(domains)):
    1.36 -        print "sudo /usr/sbin/xm create "+xen_config_name+" N="+str(N)+" && sleep 1 && sudo /usr/sbin/xm sched-credit -d $(sudo /usr/sbin/xm list | grep "+domains[N]+" | awk '{print $2}') -c 10 && sleep 1"
    1.37 +    for domain in domains:
    1.38 +        print "sudo /usr/sbin/xm create "+xentaur_path+"/xendomain "+" domain="+domain+" && sleep 1 && sudo /usr/sbin/xm sched-credit -d $(sudo /usr/sbin/xm list | grep "+domain+" | awk '{print $2}') -c 10 && sleep 1"
    1.39  
    1.40  def destroy_domains_script():
    1.41 -    for N in range(len(domains)):
    1.42 -        print "sudo /usr/sbin/xm shutdown "+domains[N]
    1.43 +    for domain in domains:
    1.44 +        print "sudo /usr/sbin/xm shutdown "+domain
    1.45  
    1.46  def create_screens_script():
    1.47      N=1