[X2Go-Commits] [x2gobroker] 03/05: agent.py: Return meaningful errors in check_load() function within the returned data structure
git-admin at x2go.org
git-admin at x2go.org
Mon Mar 30 13:28:01 CEST 2015
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository x2gobroker.
commit 9226a5906ef898d9b56a1dad3890395ed98e5fd8
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Mon Mar 30 13:23:20 2015 +0200
agent.py: Return meaningful errors in check_load() function within the returned data structure
---
x2gobroker/agent.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/x2gobroker/agent.py b/x2gobroker/agent.py
index 203b66c..b5c6b06 100644
--- a/x2gobroker/agent.py
+++ b/x2gobroker/agent.py
@@ -422,7 +422,7 @@ def check_load(remote_agent=None, logger=None, **kwargs):
_success, _load_params = call_broker_agent('foo', task='checkload', remote_agent=remote_agent, logger=logger, **kwargs)
except x2gobroker.x2gobroker_exceptions.X2GoBrokerAgentException, e:
logger.error('querying remote agent on host {hostname} failed: {errmsg}'.format(hostname=remote_agent[u'hostname'], errmsg=str(e)))
- return None
+ return "HOST-UNREACHABLE"
p = {}
for _param in _load_params:
@@ -437,7 +437,7 @@ def check_load(remote_agent=None, logger=None, **kwargs):
load_factor = long( ( (p['memAvail']/1000) * p['numCPU'] * p['typeCPU'] * 100 ) / p['loadavgXX'] )
except KeyError:
- pass
+ return "LOAD-DATA-BOGUS"
return load_factor
tasks['checkload'] = check_load
--
Alioth's /srv/git/code.x2go.org/x2gobroker.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git
More information about the x2go-commits
mailing list