[X2Go-Commits] python-x2go.git - twofactorauth (branch) updated: 0.0.36.1-21-g5854eff

X2Go dev team git-admin at x2go.org
Sat Sep 14 15:56:10 CEST 2013


The branch, twofactorauth has been updated
       via  5854eff8255d19ec57a1dfa298f941f9497870d8 (commit)
      from  fdd7a2b63ae59a19dc18ea9b30a429b457444cac (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:
 x2go/client.py |   61 +++++++++++++++++++++++++++++++++++---------------------
 1 file changed, 38 insertions(+), 23 deletions(-)

The diff of changes is:
diff --git a/x2go/client.py b/x2go/client.py
index bb92ae2..a8e8999 100644
--- a/x2go/client.py
+++ b/x2go/client.py
@@ -802,15 +802,20 @@ class X2goClient(object):
         @rtype: C{bool}
 
         """
-        if session_uuid is None and session_name is None:
-            raise x2go_exceptions.X2goClientException('can\'t resume a session without either session_uuid or session_name')
-        if session_name is None and self.session_registry(session_uuid).session_name is None:
-            raise x2go_exceptions.X2goClientException('don\'t know which session to resume')
-        if session_uuid is None:
-            session_uuid = self.session_registry.get_session_of_session_name(session_name=session_name, return_object=False)
-            return self.session_registry(session_uuid).resume()
-        else:
-            return self.session_registry(session_uuid).resume(session_name=session_name)
+        try:
+            if session_uuid is None and session_name is None:
+                raise x2go_exceptions.X2goClientException('can\'t resume a session without either session_uuid or session_name')
+            if session_name is None and self.session_registry(session_uuid).session_name is None:
+                raise x2go_exceptions.X2goClientException('don\'t know which session to resume')
+            if session_uuid is None:
+                session_uuid = self.session_registry.get_session_of_session_name(session_name=session_name, return_object=False)
+                return self.session_registry(session_uuid).resume()
+            else:
+                return self.session_registry(session_uuid).resume(session_name=session_name)
+        except x2go_exceptions.X2goControlSessionException:
+            profile_name = self.get_session_profile_name(session_uuid)
+            if self.disconnect_session(profile_name):
+                self.HOOK_on_control_session_death(profile_name)
     __resume_session = resume_session
 
     def suspend_session(self, session_uuid, session_name=None):
@@ -840,13 +845,18 @@ class X2goClient(object):
         @rtype: C{bool}
 
         """
-        if session_name is None:
-            return self.session_registry(session_uuid).suspend()
-        else:
-            for session in self.session_registry.running_sessions():
-                if session_name == session.get_session_name():
-                    return session.suspend()
-        return self.session_registry(session_uuid).control_session.suspend(session_name=session_name)
+        try:
+            if session_name is None:
+                return self.session_registry(session_uuid).suspend()
+            else:
+                for session in self.session_registry.running_sessions():
+                    if session_name == session.get_session_name():
+                        return session.suspend()
+            return self.session_registry(session_uuid).control_session.suspend(session_name=session_name)
+        except x2go_exceptions.X2goControlSessionException:
+            profile_name = self.get_session_profile_name(session_uuid)
+            if self.disconnect_session(profile_name):
+                self.HOOK_on_control_session_death(profile_name)
     __suspend_session = suspend_session
 
     def terminate_session(self, session_uuid, session_name=None):
@@ -879,13 +889,18 @@ class X2goClient(object):
         @rtype: C{bool}
 
         """
-        if session_name is None:
-            return self.session_registry(session_uuid).terminate()
-        else:
-            for session in self.session_registry.running_sessions() + self.session_registry.suspended_sessions():
-                if session_name == session.get_session_name():
-                    return session.terminate()
-        return self.session_registry(session_uuid).control_session.terminate(session_name=session_name)
+        try:
+            if session_name is None:
+                return self.session_registry(session_uuid).terminate()
+            else:
+                for session in self.session_registry.running_sessions() + self.session_registry.suspended_sessions():
+                    if session_name == session.get_session_name():
+                        return session.terminate()
+            return self.session_registry(session_uuid).control_session.terminate(session_name=session_name)
+        except x2go_exceptions.X2goControlSessionException:
+            profile_name = self.get_session_profile_name(session_uuid)
+            if self.disconnect_session(profile_name):
+                self.HOOK_on_control_session_death(profile_name)
     __terminate_session = terminate_session
 
     def get_session_profile_name(self, session_uuid):


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