xentaur

diff xentaur.py @ 32:bf2d7c5bb340

dump try and catch
author igor
date Sat Sep 22 01:35:51 2007 +0300 (2007-09-22)
parents 532f2ed25f70
children c68d804c3017
line diff
     1.1 --- a/xentaur.py	Sat Sep 22 00:09:45 2007 +0300
     1.2 +++ b/xentaur.py	Sat Sep 22 01:35:51 2007 +0300
     1.3 @@ -6,8 +6,12 @@
     1.4  xenomips_vars.N='1'
     1.5  sys.path.append('/etc/xen')
     1.6  
     1.7 -xen_config_name='netw'
     1.8 -exec 'from '+xen_config_name+' import bridges,vbridges_table, hidden_bridges, domains, broken_links, temporary_links, domain_types'
     1.9 +xen_config_name='fabergeN'
    1.10 +try:
    1.11 +    exec 'from '+xen_config_name+' import bridges,vbridges_table, hidden_bridges, domains, broken_links, temporary_links, domain_types'
    1.12 +except:
    1.13 +    print "Can't find module: %s " % (xen_config_name)
    1.14 +    sys.exit(0)
    1.15  
    1.16  bridges_turned_down=[]
    1.17  
    1.18 @@ -295,7 +299,11 @@
    1.19  
    1.20  
    1.21  def dump_start(bridge, filter=""):
    1.22 -    run_command("sudo tcpdump -w xentaur.dump -i %s %s" % (bridge,filter))
    1.23 +    try:
    1.24 +        print "Writing dump... (press Ctrl-C to stop)"
    1.25 +        run_command("sudo tcpdump -w xentaur.dump -i %s %s > /dev/null 2>&1 " % (bridge,filter))
    1.26 +    except:
    1.27 +        print "Done.\n Dump is written to xentaur.dump"
    1.28      return 0
    1.29  
    1.30  def dump_stop():