This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository python-x2go. from 857f5f3 Capture broker connection problems during selectsession calls to the broker via a HOOK method. new b462004 httpbroker: fix handling of session profile ID/name cache new db36b70 Allow user interaction via a HOOK if broker connection problems occur. new 275bea4 fix some HOOKs' __doc__ strings The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: debian/changelog | 1 + x2go/backends/profiles/httpbroker.py | 6 ++-- x2go/client.py | 52 ++++++++++++++++++++++++++++++---- 3 files changed, 49 insertions(+), 10 deletions(-) -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/python-x2go.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository python-x2go. commit b462004697fd76ba9c9d10e41a9b3c8e0302fc04 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Apr 5 01:12:19 2014 +0200 httpbroker: fix handling of session profile ID/name cache --- x2go/backends/profiles/httpbroker.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/x2go/backends/profiles/httpbroker.py b/x2go/backends/profiles/httpbroker.py index 0651833..a89edd8 100644 --- a/x2go/backends/profiles/httpbroker.py +++ b/x2go/backends/profiles/httpbroker.py @@ -173,10 +173,8 @@ class X2GoSessionProfiles(base.X2GoSessionProfiles): except KeyError: pass try: self._profiles_need_profile_id_renewal.remove(profile_id) except ValueError: pass - try: self._cached_profile_names.remove(self.to_profile_name(profile_id)) - except ValueError: pass - try: self._cached_profile_ids.remove(profile_id) - except ValueError: pass + try: del self._cached_profile_ids[profile_id] + except KeyError: pass del self.session_profiles[profile_id] self._mutable_profile_ids = None self._broker_auth_successful = False -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/python-x2go.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository python-x2go. commit db36b7017c8b7677c32a6032c86cc6151b8702f8 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Apr 5 01:13:03 2014 +0200 Allow user interaction via a HOOK if broker connection problems occur. --- debian/changelog | 1 + x2go/client.py | 35 +++++++++++++++++++++++++++++------ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index c088159..191781c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,6 +22,7 @@ python-x2go (0.5.0.0-0x2go1) UNRELEASED; urgency=low allocated. - Capture broker connection problems during selectsession calls to the broker via a HOOK method. + - Allow user interaction via a HOOK if broker connection problems occur. * debian/control: + Add dependencies: python-requests, python-simplejson. * python-x2go.spec: diff --git a/x2go/client.py b/x2go/client.py index 428f352..a219950 100644 --- a/x2go/client.py +++ b/x2go/client.py @@ -383,15 +383,33 @@ class X2GoClient(object): """ self.logger('HOOK_profile_auto_connect: profile ,,%s'' wants to be auto-connected to the X2Go server.' % profile_name, loglevel=log.loglevel_WARN) - def HOOK_broker_connection_exception(self, profile_id='UNKNOWN'): + def HOOK_broker_connection_exception(self, profile_name='UNKNOWN'): """\ HOOK method: called if a session demands to auto connect the session profile. - @param profile_id: profile ID of a session that triggered this hook method - @type profile_id: C{str} + @param profile_name: profile name of a session that triggered this hook method + @type profile_name: C{str} + + """ + self.logger('HOOK_broker_connection_exception: a broker connection problem occurred triggered by an action on profile ,,%s''.' % profile_name, loglevel=log.loglevel_WARN) + + def HOOK_broker_ignore_connection_problems(self, profile_name='UNKNOWN', is_profile_connected=False): + """\ + HOOK method: called after a broker connection failed for a certain profile. This hook can + be used to allow the user to decide how to proceed after connection problems with the broker. + + @param profile_name: profile name of a session that triggered this hook method + @type profile_name: C{str} + @param is_profile_connected: C{True} if the given session profile is already conneced to the server + @type is_profile_connected: C{bool} + + @return: If this hook returns C{True}, the session startup/resumption will be continued, even if the + broker connection is down. (Default: broker connection problems cause session start-up to fail). + @rtype: C{bool} """ - self.logger('HOOK_profile_broker_connection_exception: a broker connection problem occurred triggered by an action on profile ,,%s''.' % self.session_profiles.to_profile_name(profile_id), loglevel=log.loglevel_WARN) + self.logger('HOOK_broker_ignore_connection_problems: use this hook to let the user to decide how to proceed on connection failures (profile name: %s, connected: %s)' % (profile_name, is_profile_connected), loglevel=log.loglevel_WARN) + return False def HOOK_session_startup_failed(self, profile_name='UNKNOWN'): """\ @@ -937,8 +955,13 @@ class X2GoClient(object): server = self.session_profiles.get_server_hostname(_profile_id) _params['port'] = self.session_profiles.get_server_port(_profile_id) _pkey = self.session_profiles.get_pkey_object(_profile_id) - except x2go_exceptions.X2GoBrokerConnectionException: - self.HOOK_broker_connection_exception(_profile_id) + except x2go_exceptions.X2GoBrokerConnectionException, e: + _profile_name = self.to_profile_name(_profile_id) + self.HOOK_broker_connection_exception(_profile_name) + if not self.HOOK_broker_ignore_connection_problems(_profile_name, is_profile_connected=self.is_profile_connected(_profile_name)): + raise e + server = self.session_profiles.get_profile_config(_profile_name, parameter='host')[0] + _params['port'] = self.session_profiles.get_profile_config(_profile_name, parameter='sshport') if _pkey is not None: self.logger('received PKey object for authentication, ignoring all other auth mechanisms', log.loglevel_NOTICE, tag=self._logger_tag) -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/python-x2go.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository python-x2go. commit 275bea4fc7dc255f08945ef376f45a3081924ff0 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Sat Apr 5 01:15:47 2014 +0200 fix some HOOKs' __doc__ strings --- x2go/client.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/x2go/client.py b/x2go/client.py index a219950..c1cefb9 100644 --- a/x2go/client.py +++ b/x2go/client.py @@ -380,6 +380,9 @@ class X2GoClient(object): """\ HOOK method: called if a session demands to auto connect the session profile. + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + """ self.logger('HOOK_profile_auto_connect: profile ,,%s'' wants to be auto-connected to the X2Go server.' % profile_name, loglevel=log.loglevel_WARN) @@ -415,6 +418,9 @@ class X2GoClient(object): """\ HOOK method: called if the startup of a session failed. + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + """ self.logger('HOOK_session_startup_failed: session startup for session profile ,,%s'' failed.' % profile_name, loglevel=log.loglevel_WARN) @@ -422,6 +428,9 @@ class X2GoClient(object): """\ HOOK method: called if the startup of a shadow session was denied by the other user. + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + """ self.logger('HOOK_desktop_sharing_failed: desktop sharing for profile ,,%s'' was denied by the other user.' % profile_name, loglevel=log.loglevel_WARN) @@ -429,6 +438,9 @@ class X2GoClient(object): """\ HOOK method: called if the x2golistdesktops command generates a timeout due to long execution time. + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + """ self.logger('HOOK_list_desktops_timeout: the server-side x2golistdesktops command for session profile %s took too long to return results. This can happen from time to time, please try again.' % profile_name, loglevel=log.loglevel_WARN) @@ -436,6 +448,11 @@ class X2GoClient(object): """\ HOOK method: called if it is tried to connect to a (seen before) sharable desktop that's not available (anymore). + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + @param desktop: desktop identifier (the X session's $DISPLAY) + @type desktop: C{str} + """ self.logger('HOOK_no_such_desktop: the desktop %s (via session profile %s) is not available for sharing (anymore).' % (desktop, profile_name), loglevel=log.loglevel_WARN) -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/python-x2go.git