[X2Go-Commits] [x2gobroker] 04/05: Fix X2GoBroker.use_load_checker(): Obtain broker-* option via X2GoBroker.get_profile_broker(), not via X2GoBroker.get_profile().

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 53aa3c3cffc0792dec0f9a80f392f806acf931cb
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Mon Mar 30 13:26:16 2015 +0200

    Fix X2GoBroker.use_load_checker(): Obtain broker-* option via X2GoBroker.get_profile_broker(), not via X2GoBroker.get_profile().
---
 debian/changelog                  |    2 ++
 x2gobroker/brokers/base_broker.py |    6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index deb891f..b9f05bc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -262,6 +262,8 @@ x2gobroker (0.0.3.0-0x2go1) UNRELEASED; urgency=low
       nothing if the load checker service is unreachable.
     - agent.py: Let get_servers() return a dictionary with hostnames as keys
       and number of sessions as values.
+    - Fix X2GoBroker.use_load_checker(): Obtain broker-* option via
+      X2GoBroker.get_profile_broker(), not via X2GoBroker.get_profile().
   * 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/brokers/base_broker.py b/x2gobroker/brokers/base_broker.py
index bec6d03..2bcf255 100644
--- a/x2gobroker/brokers/base_broker.py
+++ b/x2gobroker/brokers/base_broker.py
@@ -748,12 +748,14 @@ class X2GoBroker(object):
         # it is enabled for the broker backend...
         if self.get_use_load_checker():
 
-            _profile = self.get_profile(profile_id)
+            _profile_broker = self.get_profile_broker(profile_id)
 
             # it is not explicitly disabled per session profile definition
-            if _profile and _profile.has_key(u'broker-use-load-checker') and _profile['broker-use-load-checker'] is False:
+            if _profile_broker and _profile_broker.has_key(u'broker-use-load-checker') and _profile_broker['broker-use-load-checker'] not in ('1', 'true'):
                 return False
 
+            _profile = self.get_profile(profile_id)
+
             # more than one host is defined in the session profile
             if len(_profile[u'host']) < 2:
                 return False

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