[X2Go-Commits] python-x2go.git - build-baikal (branch) updated: 0.1.1.2-5-gd5f871b

X2Go dev team git-admin at x2go.org
Wed Jan 8 15:28:40 CET 2014


The branch, build-baikal has been updated
       via  d5f871ba0fa17cd63dc3bca118844ec74f3ebb03 (commit)
      from  c84844dfe09359d4f113a533f89362581a0eb947 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 debian/changelog |    1 +
 x2go/client.py   |   12 +++++++++---
 x2go/session.py  |   16 ++++++++++++++--
 3 files changed, 24 insertions(+), 5 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index fed78c0..9ca8382 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,7 @@ python-x2go (0.1.1.3-0~x2go1) UNRELEASED; urgency=low
       trying to find a desktop for sharing.
     - Fix AttributeError if no graphical proxy instance has been declared yet.
     - Do not allow any interruption during X2go cleanup calls.
+    - Stabilize desktop sharing if the remote session is not available.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Fri, 01 Jul 2011 14:53:48 +0200
 
diff --git a/x2go/client.py b/x2go/client.py
index eba5515..d7e6fb1 100644
--- a/x2go/client.py
+++ b/x2go/client.py
@@ -1200,14 +1200,20 @@ class X2goClient(object):
         """
 
         # X2goClient.list_desktops() uses caching (if enabled, so we prefer lookups here...
-        _desktop = desktop or "%s@%s" % (user, display)
+        if desktop:
+            _desktop = desktop
+            user = None
+            display = None
+        else:
+            _desktop = '%s@%s' % (user, display)
+
         if not _desktop in self._X2goClient__list_desktops(session_uuid):
             _orig_desktop = _desktop
-            _desktop = desktop or '%s.0' % _desktop
+            _desktop = '%s.0' % _desktop
             if not _desktop in self._X2goClient__list_desktops(session_uuid):
                 raise x2go_exceptions.X2goDesktopSharingException('No such desktop ID: %s' % _orig_desktop)
 
-        return self.session_registry(session_uuid).share_desktop(desktop=desktop, user=user, display=display, share_mode=share_mode, check_desktop_list=False)
+        return self.session_registry(session_uuid).share_desktop(desktop=_desktop, share_mode=share_mode, check_desktop_list=False)
     __share_desktop_session = share_desktop_session
 
     def resume_session(self, session_uuid=None, session_name=None):
diff --git a/x2go/session.py b/x2go/session.py
index 9b9704e..d4500d1 100644
--- a/x2go/session.py
+++ b/x2go/session.py
@@ -1099,10 +1099,22 @@ class X2goSession(object):
                 if not _desktop in self._X2GoSession__list_desktops():
                     raise X2goDesktopSharingException('No such desktop ID: %s' % _orig_desktop)
 
+        _session_owner = _desktop.split('@')[0]
+        _display = _desktop.split('@')[1]
+
         if self.is_alive():
+            if self.get_username() != _session_owner:
+                self.logger('waiting for user ,,%s\'\' to interactively grant you access to his/her desktop session...' % _session_owner, loglevel=log.loglevel_NOTICE)
+                self.logger('THIS MAY TAKE A WHILE!', loglevel=log.loglevel_NOTICE)
+
             _control = self.control_session
-            self.terminal_session = _control.share_desktop(desktop=desktop, user=user, display=display, share_mode=share_mode,
-                                                           logger=self.logger, **self.terminal_params)
+            try:
+                self.terminal_session = _control.share_desktop(desktop=_desktop, share_mode=share_mode,
+                                                               logger=self.logger, **self.terminal_params)
+            except ValueError:
+                # x2gostartagent output parsing will result in a ValueError. This one we will catch
+                # here and change it into an X2goSessionException
+                raise X2goSessionException('the session on desktop %s is seemingly dead' % _desktop)
 
             if self.has_terminal_session():
                 self.session_name = self.terminal_session.session_info.name


hooks/post-receive
-- 
python-x2go.git (Python X2Go Client API)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-x2go.git" (Python X2Go Client API).




More information about the x2go-commits mailing list