Browse Source

[IMP] support really old psutils

pull/303/head
Holger Brunn 9 years ago
parent
commit
b92bed686f
  1. 4
      dead_mans_switch_client/models/dead_mans_switch_client.py

4
dead_mans_switch_client/models/dead_mans_switch_client.py

@ -36,10 +36,14 @@ class DeadMansSwitchClient(orm.AbstractModel):
for process in processes:
if hasattr(process, 'memory_percent'):
ram += process.memory_percent()
elif hasattr(process, 'get_memory_percent'):
ram += process.get_memory_percent()
else:
ram = None
if hasattr(process, 'cpu_percent'):
cpu += process.cpu_percent()
elif hasattr(process, 'get_cpu_percent'):
cpu += process.get_cpu_percent()
else:
cpu = None
return {

Loading…
Cancel
Save