From b5d1e1d334c7cd163478a8d445341f7c0aea458b Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Thu, 3 Dec 2015 14:12:30 +0100 Subject: [PATCH] [ADD] tell the server that we don't know a value --- dead_mans_switch_client/models/dead_mans_switch_client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dead_mans_switch_client/models/dead_mans_switch_client.py b/dead_mans_switch_client/models/dead_mans_switch_client.py index 6f64f919d..0d7fdf7e9 100644 --- a/dead_mans_switch_client/models/dead_mans_switch_client.py +++ b/dead_mans_switch_client/models/dead_mans_switch_client.py @@ -40,8 +40,12 @@ class DeadMansSwitchClient(models.AbstractModel): for process in processes: if hasattr(process, 'memory_percent'): ram += process.memory_percent() + else: + ram = None if hasattr(process, 'cpu_percent'): cpu += process.cpu_percent() + else: + cpu = None user_count = 0 if 'im_chat.presence' in self.env.registry: user_count = len(self.env['im_chat.presence'].search([