[X2go-Commits] python-x2go.git - master (branch) updated: 0.1.0.3-23-g9dbd64e

X2go dev team git-admin at x2go.org
Tue Jun 21 14:21:23 CEST 2011


The branch, master has been updated
       via  9dbd64ed33bd983ac81693493fa56eb5b7827f1e (commit)
       via  d5f0709a91e364d88ae76d95235d6f02860f3d68 (commit)
       via  476adefe5f6f1c81e03d6cc3be01e8b8777eff67 (commit)
      from  7f32339cfcfcabdbb701decef90a08f9d797b421 (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 9dbd64ed33bd983ac81693493fa56eb5b7827f1e
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Tue Jun 21 14:21:19 2011 +0200

    Make sure list session and list desktop commands always return.

commit d5f0709a91e364d88ae76d95235d6f02860f3d68
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Tue Jun 21 14:20:27 2011 +0200

    Add debug output that signals that the X2goGuardian loop is running...

commit 476adefe5f6f1c81e03d6cc3be01e8b8777eff67
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Tue Jun 21 14:18:38 2011 +0200

    Make stylish adjustments...

-----------------------------------------------------------------------

Summary of changes:
 debian/changelog                 |    3 ++-
 x2go/backends/control/_stdout.py |   22 ++++++++--------------
 x2go/guardian.py                 |    3 +++
 x2go/registry.py                 |    6 +++---
 4 files changed, 16 insertions(+), 18 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 2ff1b74..801b4fc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,8 +6,9 @@ python-x2go (0.1.1.0-0~x2go1) UNRELEASED; urgency=low
     - Close SSH connection first, then close down SSH proxy.
     - Make sure SSH proxy password gets forgotten between two sessions.
     - Add X2goSession status property ,,faulty''.
+    - Make sure list session and list desktop commands always return.
 
- -- Mike Gabriel <mike at mimino.das-netzwerkteam.de>  Mon, 20 Jun 2011 14:16:54 +0200
+ -- Mike Gabriel <mike at mimino.das-netzwerkteam.de>  Tue, 21 Jun 2011 14:20:48 +0200
 
 python-x2go (0.1.0.3-0~x2go1) unstable; urgency=low
 
diff --git a/x2go/backends/control/_stdout.py b/x2go/backends/control/_stdout.py
index c3e5725..8c7a617 100644
--- a/x2go/backends/control/_stdout.py
+++ b/x2go/backends/control/_stdout.py
@@ -187,8 +187,6 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient):
             try:
                 self.logger('executing command on X2go server: %s' % _rerewrite_blanks(cmd), loglevel)
                 _retval = self.exec_command(_rewrite_password(cmd, user=self.get_transport().get_username(), password=self._session_password), **kwargs)
-                self.locked = False
-                timeout.cancel()
             except AttributeError:
                 self.session_died = True
                 if self.sshproxy_session:
@@ -656,15 +654,8 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient):
 
                 _stdout_read = stdout.read()
 
-                try:
-                    _listdesktops = _stdout_read.split('\n')
-                    _success = True
-                except KeyError:
-                    gevent.sleep(1)
-                except IndexError:
-                    gevent.sleep(1)
-                except ValueError:
-                    gevent.sleep(1)
+                _listdesktops = _stdout_read.split('\n')
+                _success = True
 
             return _listdesktops
 
@@ -683,17 +674,20 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient):
 
         """
         if raw:
-            (stdin, stdout, stderr) = self._x2go_exec_command("x2golistsessions")
+            (stdin, stdout, stderr) = self._x2go_exec_command("export HOSTNAME && x2golistsessions")
             return stdout.read(), stderr.read()
 
         else:
 
             # this _success loop will catch errors in case the x2golistsessions output is corrupt
             # this should not be needed and is a workaround for the current X2go server implementation
+            _listsessions = {}
             _success = False
-            while not _success:
+            _count = 0
+            while not _success or _count < 50:
 
-                (stdin, stdout, stderr) = self._x2go_exec_command("x2golistsessions")
+                _count += 2
+                (stdin, stdout, stderr) = self._x2go_exec_command("export HOSTNAME && x2golistsessions")
 
                 _stdout_read = stdout.read()
 
diff --git a/x2go/guardian.py b/x2go/guardian.py
index 42943bd..36b0623 100644
--- a/x2go/guardian.py
+++ b/x2go/guardian.py
@@ -106,6 +106,9 @@ class X2goSessionGuardian(threading.Thread):
 
             if seconds % self.refresh_interval == 0:
 
+                self.logger('Entering X2go Guardian client management loop...', loglevel=log.loglevel_DEBUG)
+
+
                 if self.auto_update_listsessions_cache:
                     self.client_instance.update_cache_all_profiles()
 
diff --git a/x2go/registry.py b/x2go/registry.py
index e2665d7..033a631 100644
--- a/x2go/registry.py
+++ b/x2go/registry.py
@@ -234,7 +234,7 @@ class X2goSessionRegistry(object):
                 if len(self.virgin_sessions_of_profile_name(profile_name)) > 1:
                     del self.registry[_session_uuid]
 
-            elif _last_status['running'] == False and _current_status['running'] == True and not _current_status['faulty']:
+            elif _last_status['running'] == False and _current_status['running'] == True and _current_status['faulty'] == False:
                 # session has started
                 if _last_status['connected']:
                     if self(_session_uuid).has_terminal_session():
@@ -255,11 +255,11 @@ class X2goSessionRegistry(object):
                     # from a suspended state
                     self.client_instance.HOOK_on_found_session_running_after_connect(session_uuid=_session_uuid, profile_name=_profile_name, session_name=_session_name)
 
-            elif _last_status['connected'] == True and (_last_status['suspended'] == False and _current_status['suspended'] == True) and not _current_status['faulty']:
+            elif _last_status['connected'] == True and (_last_status['suspended'] == False and _current_status['suspended'] == True) and _current_status['faulty'] == False:
                 # session has been suspended
                 self(_session_uuid).session_cleanup()
                 self.client_instance.HOOK_on_session_has_been_suspended(session_uuid=_session_uuid, profile_name=_profile_name, session_name=_session_name)
-            elif _last_status['connected'] == True and (_last_status['terminated'] == False and _current_status['terminated'] == True) and not _current_status['faulty']:
+            elif _last_status['connected'] == True and (_last_status['terminated'] == False and _current_status['terminated'] == True) and _current_status['faulty'] == False:
                 # session has terminated
                 self.client_instance.HOOK_on_session_has_terminated(session_uuid=_session_uuid, profile_name=_profile_name, session_name=_session_name)
                 self(_session_uuid).session_cleanup()


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