[X2Go-Commits] [x2gobroker] 16/17: Make hostname detection work for the default configuration (that defines localhost session profiles).

git-admin at x2go.org git-admin at x2go.org
Mon Oct 9 10:40:06 CEST 2017


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

x2go pushed a commit to branch master
in repository x2gobroker.

commit f553365f07fe508433d375ea98049923ee023568
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Sun Sep 24 18:08:27 2017 +0200

    Make hostname detection work for the default configuration (that defines localhost session profiles).
---
 x2gobroker/brokers/base_broker.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/x2gobroker/brokers/base_broker.py b/x2gobroker/brokers/base_broker.py
index 95b6cc4..b6a6ee6 100644
--- a/x2gobroker/brokers/base_broker.py
+++ b/x2gobroker/brokers/base_broker.py
@@ -26,6 +26,7 @@ __NAME__ = 'x2gobroker-pylib'
 
 # modules
 import copy
+import socket
 import uuid
 import netaddr
 import random
@@ -1358,6 +1359,14 @@ class X2GoBroker(object):
 
         while not selected_session and server_list:
 
+            # X2Go Server uses the system's hostname, so let's replace
+            # that here automatically, if we tested things via localhost...
+            for h in server_list:
+                if h == 'localhost':
+                      server_list.remove(h)
+                      server_list.append(socket.gethostname())
+
+            matching_server_names = None
             if session_list:
                 matching_server_names = x2gobroker.utils.matching_hostnames(server_list, [ si.split('|')[3] for si in session_list ])
 

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