[X2Go-Commits] [python-x2go] 02/08: Only convert the value of the export session profile option if not already a Python dictionary.

git-admin at x2go.org git-admin at x2go.org
Mon Oct 20 12:43:08 CEST 2014


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

x2go pushed a commit to branch build-main
in repository python-x2go.

commit d90c4b182aef55cdbac2d0151792291d4629e865
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Mon Oct 20 09:24:37 2014 +0200

    Only convert the value of the export session profile option if not already a Python dictionary.
---
 debian/changelog               |    2 ++
 x2go/backends/profiles/base.py |   14 +++++++-------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 97aa7bf..c2a079f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -119,6 +119,8 @@ python-x2go (0.5.0.0-0x2go1) UNRELEASED; urgency=low
     - Make sure we do a deepcopy of the default session profile parameters.
     - Detect more exceptions in the requests module when authenticating against a
       session broker.
+    - Only convert the value of the export session profile option if not
+      already a Python dictionary.
   * debian/control:
     + Add dependencies: python-requests, python-simplejson.
     + Add R (python-x2go): sshfs.
diff --git a/x2go/backends/profiles/base.py b/x2go/backends/profiles/base.py
index 4275a99..46f8387 100644
--- a/x2go/backends/profiles/base.py
+++ b/x2go/backends/profiles/base.py
@@ -337,20 +337,20 @@ class X2GoSessionProfiles():
         for option in parameters:
             value = self._get_profile_parameter(_profile_id, option, key_type=self.get_profile_option_type(option))
 
-            if option == 'export':
-                _strvalue = value.replace(',', ';').strip().strip('"').strip().strip(';').strip()
+            if type(value) is types.StringType:
+                value = unicode(value)
+
+            if option == 'export' and value is types.UnicodeType:
+                _value = value.replace(',', ';').strip().strip('"').strip().strip(';').strip()
                 value = {}
-                if _strvalue:
-                    _export_paths = _strvalue.split(';')
+                if _value:
+                    _export_paths = _value.split(';')
                     for _path in _export_paths:
                         if not re.match('.*:(0|1)$', _path): _path = '%s:1' % _path
                         _auto_export_path = re.match('.*:1$', _path) and True or False
                         _export_path = ':'.join(_path.split(':')[:-1])
                         value[_export_path] = _auto_export_path
 
-            if type(value) is types.StringType:
-                value = unicode(value)
-
             _profile_config[option] = value
 
         if parameter is not None:

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