[X2Go-Commits] python-x2go.git - build-baikal (branch) updated: 0.1.0.3-38-gccbabb8

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


The branch, build-baikal has been updated
       via  ccbabb821c111c7bd01eae23c6e1a156029d97bc (commit)
      from  f046c26dbdb42ac59cdf994ba6e53791391704d7 (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 |    4 +++-
 x2go/client.py   |   13 ++++++++++++-
 x2go/registry.py |   21 ++++++++++++++++++++-
 3 files changed, 35 insertions(+), 3 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 52c3ccc..418c440 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -22,8 +22,10 @@ python-x2go (0.1.1.0-0~x2go1) UNRELEASED; urgency=low
     - Test focus put on client inter-operation. It is reliably possible now to move
       sessions between different clients without resume failures.
     - Add X2goSession lock support.
+    - Skip session auto registration during startups of new sessions (avoids
+      duplicate sessions in the session registry.
 
- -- Mike Gabriel <mike at mimino.das-netzwerkteam.de>  Wed, 22 Jun 2011 01:20:48 +0200
+ -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Thu, 23 Jun 2011 08:34:14 +0200
 
 python-x2go (0.1.0.3-0~x2go1) unstable; urgency=low
 
diff --git a/x2go/client.py b/x2go/client.py
index bf31391..9cce864 100644
--- a/x2go/client.py
+++ b/x2go/client.py
@@ -1126,7 +1126,18 @@ class X2goClient(object):
         @rtype: C{bool}
 
         """
-        return self.session_registry(session_uuid).start()
+        # prevent the newly started session from being registered twice
+        if self.auto_register_sessions:
+            self.session_registry.disable_session_auto_registration()
+
+        # start the actual session
+        _retval = self.session_registry(session_uuid).start()
+
+        # re-enable session auto-registration...
+        if self.auto_register_sessions:
+            self.session_registry.enable_session_auto_registration()
+
+        return _retval
     __start_session = start_session
 
     def share_desktop_session(self, session_uuid, desktop=None, user=None, display=None, share_mode=0):
diff --git a/x2go/registry.py b/x2go/registry.py
index f11c045..4cda525 100644
--- a/x2go/registry.py
+++ b/x2go/registry.py
@@ -80,6 +80,7 @@ class X2goSessionRegistry(object):
         self.control_sessions = {}
 
         self._last_available_session_registration = None
+        self._skip_auto_registration = False
 
     def keys(self):
         """\
@@ -113,6 +114,24 @@ class X2goSessionRegistry(object):
         except KeyError:
             raise X2goSessionException('No session found for UUID %s' % session_uuid)
 
+    def disable_session_auto_registration(self):
+        """\
+        This method is used to temporarily skip auto-registration of newly appearing
+        X2go session on the server side. This is necessary during session startups to
+        assure that the session registry does not get filled with session UUID 
+        duplicates.
+
+        """
+        self._skip_auto_registration = True
+
+    def enable_session_auto_registration(self):
+        """\
+        This method is used to temporarily (re-)enable auto-registration of newly appearing
+        X2go session on the server side.
+
+        """
+        self._skip_auto_registration = False
+
     def forget(self, session_uuid):
         """\
         Forget the complete record for session UUID C{session_uuid}.
@@ -325,7 +344,7 @@ class X2goSessionRegistry(object):
             # (if the server name has changed, this will kick out obsolete X2goSessions)
             self.update_status(profile_name=profile_name, session_list=session_list, force_update=True)
             for session_name in session_list.keys():
-                if session_name not in _session_names:
+                if session_name not in _session_names and not self._skip_auto_registration:
                     server = _ctrl_session.get_server_hostname()
                     profile_id = _ctrl_session.get_profile_id()
 


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