[X2Go-Commits] [x2gobroker] 02/02: If a single-host is unreachable, return the host address, not the hostname and let X2Go Client release itself, that the host is unreachable.

git-admin at x2go.org git-admin at x2go.org
Wed Apr 1 10:01:02 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 1abd30cc277c907f1552382b53c61da8689c24ae
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Wed Apr 1 10:00:51 2015 +0200

    If a single-host is unreachable, return the host address, not the hostname and let X2Go Client release itself, that the host is unreachable.
---
 debian/changelog                  |    2 ++
 x2gobroker/brokers/base_broker.py |   10 ++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index b75b4c8..d51bd70 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -294,6 +294,8 @@ x2gobroker (0.0.3.0-0x2go1) UNRELEASED; urgency=low
       mode. Avoid logging of the configured query mode. Write the overridden
       query mode to the logger instance instead.
     - Don't enforce agent query mode "SSH" for x2gobroker-ssh anymore.
+    - If a single-host is unreachable, return the host address, not the hostname
+      and let X2Go Client release itself, that the host is unreachable.
   * 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 407db5c..6b10c78 100644
--- a/x2gobroker/brokers/base_broker.py
+++ b/x2gobroker/brokers/base_broker.py
@@ -1591,9 +1591,15 @@ class X2GoBroker(object):
                 }
             else:
                 # hand-over the original hostname for non-load-balanced session profiles
+                failed_server_port = server_port
+                failed_server_name = initial_server_list[0]
+                try: failed_server_port = profile['port={hostname}'.format(hostname=failed_server_name)]
+                except KeyError: pass
+                try: failed_server_name = profile['host={hostname}'.format(hostname=failed_server_name)]
+                except KeyError: pass
                 selected_session = {
-                    u'server': initial_server_list[0],
-                    u'port': server_port,
+                    u'server': failed_server_name,
+                    u'port': failed_server_port,
                 }
 
         # are we resuming a running/suspended session?

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