# HG changeset patch # User igor # Date 1190414151 -10800 # Node ID bf2d7c5bb340cce17d205dc125579d92ce395041 # Parent 532f2ed25f70e8f9b771b25bcced7418e2cfc3e5 dump try and catch diff -r 532f2ed25f70 -r bf2d7c5bb340 xentaur.py --- a/xentaur.py Sat Sep 22 00:09:45 2007 +0300 +++ b/xentaur.py Sat Sep 22 01:35:51 2007 +0300 @@ -6,8 +6,12 @@ xenomips_vars.N='1' sys.path.append('/etc/xen') -xen_config_name='netw' -exec 'from '+xen_config_name+' import bridges,vbridges_table, hidden_bridges, domains, broken_links, temporary_links, domain_types' +xen_config_name='fabergeN' +try: + exec 'from '+xen_config_name+' import bridges,vbridges_table, hidden_bridges, domains, broken_links, temporary_links, domain_types' +except: + print "Can't find module: %s " % (xen_config_name) + sys.exit(0) bridges_turned_down=[] @@ -295,7 +299,11 @@ def dump_start(bridge, filter=""): - run_command("sudo tcpdump -w xentaur.dump -i %s %s" % (bridge,filter)) + try: + print "Writing dump... (press Ctrl-C to stop)" + run_command("sudo tcpdump -w xentaur.dump -i %s %s > /dev/null 2>&1 " % (bridge,filter)) + except: + print "Done.\n Dump is written to xentaur.dump" return 0 def dump_stop():