[X2Go-Commits] python-x2go.git - twofactorauth (branch) updated: 0.1.1.4-27-g8a9eb20

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


The branch, twofactorauth has been updated
       via  8a9eb2072d948116d1ce9d668be2656c15861be8 (commit)
      from  0389489a4e5d4479ddfa48979d41749bef80245a (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/backends/info/_stdout.py     |   48 ++++++++++++++++++++++++-------------
 x2go/backends/terminal/_stdout.py |   13 ++++++----
 3 files changed, 41 insertions(+), 21 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 6bb444a..6f9b1b7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,7 @@ python-x2go (0.1.1.5-0~x2go1) unstable; urgency=low
       Kniep for digging this out).
     - Make X2goTerminalSessionSTDOUT.has_command resistable against empty command
       strings.
+    - Catching fautly x2gostartagent behaviour.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Tue, 19 Jul 2011 20:44:30 +0200
 
diff --git a/x2go/backends/info/_stdout.py b/x2go/backends/info/_stdout.py
index 3eef7ce..529a8f3 100644
--- a/x2go/backends/info/_stdout.py
+++ b/x2go/backends/info/_stdout.py
@@ -87,23 +87,37 @@ class X2goServerSessionInfoSTDOUT(object):
         Parse x2gostartagent output.
 
         """
-        l = x2go_output.split("\n")
-        self.name = l[3]
-        self.cookie = l[1]
-        self.agent_pid = int(l[2])
-        self.display = int(l[0])
-        self.graphics_port = int(l[4])
-        self.snd_port = int(l[5])
-        self.sshfs_port = int(l[6])
-        self.username = ''
-        self.hostname = ''
-        # TODO: we have to see how we fill these fields here...
-        self.date_created = ''
-        self.date_suspended = ''
-        # TODO: presume session is running after x2gostartagent, this could be better
-        self.status = 'R'
-        self.local_container = ''
-        self.remote_container = ''
+        try:
+            l = x2go_output.split("\n")
+            self.name = l[3]
+            self.cookie = l[1]
+            self.agent_pid = int(l[2])
+            self.display = int(l[0])
+            self.graphics_port = int(l[4])
+            self.snd_port = int(l[5])
+            self.sshfs_port = int(l[6])
+            self.username = ''
+            self.hostname = ''
+            # TODO: we have to see how we fill these fields here...
+            self.date_created = ''
+            self.date_suspended = ''
+            # TODO: presume session is running after x2gostartagent, this could be better
+            self.status = 'R'
+            self.local_container = ''
+            self.remote_container = ''
+        except IndexError, e:
+            # DEBUGGING CODE
+            print 'Encountered IndexError: %s' % str(e)
+            print 'THIS SHOULD NOT HAPPEN... HERE IS THE x2golistsessions OUTPUT THAT CAUSED THE ERROR...'
+            print x2go_output
+            raise e
+        except ValueError, e:
+            # DEBUGGING CODE
+            print 'Encountered IndexError: %s' % str(e)
+            print 'THIS SHOULD NOT HAPPEN... HERE IS THE x2golistsessions OUTPUT THAT CAUSED THE ERROR...'
+            print x2go_output
+            raise e
+
 
     def initialize(self, x2go_output, username='', hostname='', local_container='', remote_container=''):
         """\
diff --git a/x2go/backends/terminal/_stdout.py b/x2go/backends/terminal/_stdout.py
index 04b58a3..8f00822 100644
--- a/x2go/backends/terminal/_stdout.py
+++ b/x2go/backends/terminal/_stdout.py
@@ -869,10 +869,15 @@ class X2goTerminalSessionSTDOUT(object):
         if "ACCESS DENIED" in _stderr and "XSHAD" in _stderr:
             raise x2go_exceptions.X2goDesktopSharingException('X2go desktop sharing has been denied by the remote user')
 
-        self.session_info.initialize(_stdout,
-                                     username=self.control_session.remote_username(),
-                                     hostname=self.control_session.get_transport().getpeername(),
-                                    )
+        try:
+            self.session_info.initialize(_stdout,
+                                         username=self.control_session.remote_username(),
+                                         hostname=self.control_session.get_transport().getpeername(),
+                                        )
+        except ValueError:
+            raise X2goTerminalSessionException("failed to start X2go session")
+        except IndexError:
+            raise X2goTerminalSessionException("failed to start X2go session")
 
         # local path may be a Windows path, so we use the path separator of the local system
         self.session_info.local_container = os.path.join(self.params.rootdir, 'S-%s' % self.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