[X2Go-Commits] [x2gobroker] 02/03: agent.py: Capture login failures in checkload() function.

git-admin at x2go.org git-admin at x2go.org
Thu Mar 26 17:13:07 CET 2015


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2gobroker.

commit c4d25bbc8cd61ef1875b78a8861ed04f9cf0d2d2
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Thu Mar 26 17:08:25 2015 +0100

    agent.py: Capture login failures in checkload() function.
---
 debian/changelog    |    1 +
 x2gobroker/agent.py |    6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 4ed820c..ead864e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -243,6 +243,7 @@ x2gobroker (0.0.3.0-0x2go1) UNRELEASED; urgency=low
     - x2gobroker.1: Mention x2gobroker-ssh in its man page, differentiate
       between the different modes (http/ssh) of the x2gobroker application.
     - Pre-release pyflakes cleanup.
+    - agent.py: Capture login failures in checkload() function.
   * debian/control:
     + Provide separate bin:package for SSH brokerage: x2gobroker-ssh.
     + Replace LDAP support with session brokerage support in LONG_DESCRIPTION.
diff --git a/x2gobroker/agent.py b/x2gobroker/agent.py
index 566a8c0..8869cf5 100644
--- a/x2gobroker/agent.py
+++ b/x2gobroker/agent.py
@@ -368,7 +368,11 @@ def checkload(remote_agent=None, **kwargs):
     @rtype: C{tuple}
 
     """
-    _success, _load_params = call_broker_agent('foo', task='checkload', remote_agent=remote_agent, **kwargs)
+    try:
+        _success, _load_params = call_broker_agent('foo', task='checkload', remote_agent=remote_agent, **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
 
     p = {}
     for _param in _load_params:

--
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