Commit 6abc6969 by Szeberényi Imre

psutil exception handling in collect_vms

parent 992a796d
......@@ -157,8 +157,8 @@ class Client:
now = time.time()
running_vms = []
for entry in psutil.get_process_list():
try:
try:
for entry in psutil.get_process_list():
if entry.name() in ('kvm', 'qemu-system-x86_64'):
parser = argparse.ArgumentParser()
parser.add_argument('-name')
......@@ -191,8 +191,8 @@ class Client:
else:
logger.warning('Pid: %d args.name is empty?: %s %s', entry.pid, entry.name(), entry.cmdline())
except psutil.NoSuchProcess, TypeError:
logger.warning('Process %d lost. Entry: %s', entry.pid, entry.cmdline()[1:])
except (psutil.NoSuchProcess, TypeError):
logger.warning('Process %d lost. Entry: %s', entry.pid, entry.cmdline()[0:])
interfaces = psutil.network_io_counters(pernic=True)
for interface, data in interfaces.iteritems():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment