[X2Go-Commits] [python-x2go] 02/03: X2GoSessionProfile.get_server_hostname must return unicode objects.

git-admin at x2go.org git-admin at x2go.org
Tue Mar 18 09:43:09 CET 2014


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

x2go pushed a commit to branch master
in repository python-x2go.

commit 580cb0ee532e34fec7f5670e2f555c2d782b85ee
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Tue Mar 18 09:42:08 2014 +0100

    X2GoSessionProfile.get_server_hostname must return unicode objects.
---
 debian/changelog               |    1 +
 x2go/backends/profiles/base.py |    4 ++--
 x2go/backends/profiles/file.py |    2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index f9f4bf5..4052101 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,7 @@ python-x2go (0.5.0.0-0x2go1) UNRELEASED; urgency=low
     - Default to xdg-open as default PDF viewer command.
     - Provide session profile backend for a http broker.
     - Make session profile backends more unicode robust.
+    - X2GoSessionProfile.get_server_hostname must return unicode objects.
   * debian/control:
     + Add dependencies: python-requests, python-simplejson.
   * python-x2go.spec:
diff --git a/x2go/backends/profiles/base.py b/x2go/backends/profiles/base.py
index 641e5e4..7275869 100644
--- a/x2go/backends/profiles/base.py
+++ b/x2go/backends/profiles/base.py
@@ -669,7 +669,7 @@ class X2GoSessionProfiles():
         @rtype: C{list}
 
         """
-        return self._get_server_hostname(profile_id)
+        return unicode(self._get_server_hostname(profile_id))
 
     def _get_server_hostname(self, profile_id):
         """\
@@ -684,7 +684,7 @@ class X2GoSessionProfiles():
         @rtype: C{list}
 
         """
-        return [u'localhost']
+        return u'localhost'
 
     def get_server_port(self, profile_id):
         """\
diff --git a/x2go/backends/profiles/file.py b/x2go/backends/profiles/file.py
index 0f08336..ffe3ad5 100644
--- a/x2go/backends/profiles/file.py
+++ b/x2go/backends/profiles/file.py
@@ -120,7 +120,7 @@ class X2GoSessionProfiles(base.X2GoSessionProfiles, inifiles.X2GoIniFile):
         return [ s for s in self.iniConfig.sections() if s != "none" ]
 
     def _get_server_hostname(self, profile_id):
-        return self.get_profile_config(profile_id)['host']
+        return random.choice(self.get_profile_config(profile_id)['host'])
 
     def _get_server_port(self, profile_id):
         return self.get_profile_config(profile_id)['sshport']

--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/python-x2go.git



More information about the x2go-commits mailing list