[X2go-Commits] python-x2go.git - master (branch) updated: 0.1.1.4-61-g6126afe

X2go dev team git-admin at x2go.org
Tue Sep 27 20:49:28 CEST 2011


The branch, master has been updated
       via  6126afedc1af9473b2b3581ac4f2c64663b9810e (commit)
       via  ee2ce40e07dede7165912d0890f161780e946f2b (commit)
      from  7a7a93082f9791c56f5fc98b30562d0c4408e8be (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 6126afedc1af9473b2b3581ac4f2c64663b9810e
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Tue Sep 27 20:48:38 2011 +0200

    Always disconnect from X2goSession instance.

commit ee2ce40e07dede7165912d0890f161780e946f2b
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Tue Sep 27 20:47:53 2011 +0200

    Catch failures on sftp_write in control session instance.

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

Summary of changes:
 debian/changelog                 |    2 ++
 x2go/backends/control/_stdout.py |   12 +++++++-----
 x2go/session.py                  |    3 +++
 3 files changed, 12 insertions(+), 5 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 81122b0..b2c7439 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,8 @@ python-x2go (0.1.1.8-0-x2go1) UNRELEASED; urgency=low
     - Unshare local folders during session cleanup.
     - Remove local session cache folders after sessions have terminated.
     - Fix missing import of socket module in backends/control/_stdout.py.
+    - Catch failures on sftp_write in control session instance.
+    - Always disconnect from X2goSession instance.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Sun, 25 Sep 2011 02:08:11 +0200
 
diff --git a/x2go/backends/control/_stdout.py b/x2go/backends/control/_stdout.py
index 5e7d2a3..0a61c50 100644
--- a/x2go/backends/control/_stdout.py
+++ b/x2go/backends/control/_stdout.py
@@ -160,10 +160,13 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient):
     def _x2go_sftp_write(self, remote_path, content):
 
         self.logger('sFTP-write: opening remote file %s on host %s for writing' % (remote_path, self.get_transport().getpeername()), loglevel=log.loglevel_DEBUG)
-        remote_fileobj = self.sftp_client.open(remote_path, 'w')
-        self.logger('sFTP-write: writing content: %s' % content, loglevel=log.loglevel_DEBUG_SFTPXFER)
-        remote_fileobj.write(content)
-        remote_fileobj.close()
+        try:
+            remote_fileobj = self.sftp_client.open(remote_path, 'w')
+            self.logger('sFTP-write: writing content: %s' % content, loglevel=log.loglevel_DEBUG_SFTPXFER)
+            remote_fileobj.write(content)
+            remote_fileobj.close()
+        except SSHException:
+            self.logger('sFTP-write: opening remote file %s on host %s failed' % (remote_path, self.get_transport().getpeername()), loglevel=log.loglevel_WARN)
 
     def _x2go_sftp_remove(self, remote_path):
 
@@ -495,7 +498,6 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient):
             self.session_died = False
 
         if not self.home_exists():
-            self.disconnect()
             raise x2go_exceptions.X2goRemoteHomeException('remote home directory does not exist')
 
         return (self.get_transport() is not None)
diff --git a/x2go/session.py b/x2go/session.py
index 65c9689..63cdd64 100644
--- a/x2go/session.py
+++ b/x2go/session.py
@@ -773,6 +773,9 @@ class X2goSession(object):
                                                               **_params)
             except X2goControlSessionException, e:
                 raise X2goSessionException(str(e))
+            except X2goRemoteHomeException, e:
+                self.disconnect()
+                raise e
             except:
                 # remove credentials immediately
                 self.control_params['password'] = ''


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