[X2go-Commits] python-x2go.git - release/0.1.1.x (branch) updated: 0.1.1.4-25-gdf3fab7
X2go dev team
git-admin at x2go.org
Sat Sep 10 01:20:16 CEST 2011
The branch, release/0.1.1.x has been updated
via df3fab737e8dd0d1cf6a42afc296fed407468284 (commit)
from 73cf843144b4363d265b946567e7a4484e335558 (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 -----------------------------------------------------------------
commit df3fab737e8dd0d1cf6a42afc296fed407468284
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Sat Sep 10 01:21:02 2011 +0200
Catching fautly x2gostartagent behaviour.
-----------------------------------------------------------------------
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 e8f0286..11455cb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,7 @@ python-x2go (0.1.1.5-0~x2go1) UNRELEASED; 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 b59880e..5cae736 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 331119b..92dac9f 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