summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2009-01-08 21:03:44 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2009-01-08 21:03:44 +0000
commitd171e39de8f61c089526998b52841d8c8655f791 (patch)
tree0b957492f663c3740fb31e14c5d5f4846cb2f050
parentf4400c2a968e3ba8e69c4140de79fd288d9480ea (diff)
downloadrdiff-backup-d171e39de8f61c089526998b52841d8c8655f791.tar.gz
Print more helpful error messages when the remote command cannot be started
on Windows. Fix --test-server option when used with remote Windows clients. git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@1011 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/CHANGELOG6
-rw-r--r--rdiff-backup/rdiff_backup/SetConnections.py16
-rw-r--r--rdiff-backup/rdiff_backup/connection.py2
3 files changed, 18 insertions, 6 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index c35b4a0..3673e88 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -1,6 +1,12 @@
New in v1.3.1 (????/??/??)
---------------------------
+Print more helpful error messages when the remote command cannot be started
+on Windows. Thanks to Dominic for the bug report. (Andrew Ferguson)
+
+Fix --test-server option when used with remote Windows clients. Thanks to
+Thanos Diacakis for testing. (Andrew Ferguson)
+
Fix --override-chars-to-quote option. (Andrew Ferguson)
Fix typo in robust.py which broke error reporting. Closes Savannah bug #25255.
diff --git a/rdiff-backup/rdiff_backup/SetConnections.py b/rdiff-backup/rdiff_backup/SetConnections.py
index 465fcb3..d4e1a59 100644
--- a/rdiff-backup/rdiff_backup/SetConnections.py
+++ b/rdiff-backup/rdiff_backup/SetConnections.py
@@ -119,7 +119,10 @@ def parse_file_desc(file_desc):
def fill_schema(host_info):
"""Fills host_info into the schema and returns remote command"""
- return __cmd_schema % host_info
+ try:
+ return __cmd_schema % host_info
+ except TypeError:
+ Log.FatalError("Invalid remote schema:\n\n%s\n" % __cmd_schema)
def init_connection(remote_cmd):
"""Run remote_cmd, register connection, and then return it
@@ -134,10 +137,13 @@ def init_connection(remote_cmd):
Log("Executing " + remote_cmd, 4)
if os.name == "nt":
import subprocess
- process = subprocess.Popen(remote_cmd, shell=False, bufsize=0,
+ try:
+ process = subprocess.Popen(remote_cmd, shell=False, bufsize=0,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
- (stdin, stdout) = (process.stdin, process.stdout)
+ (stdin, stdout) = (process.stdin, process.stdout)
+ except OSError:
+ (stdin, stdout) = (None, None)
else:
stdin, stdout = os.popen2(remote_cmd)
conn_number = len(Globals.connections)
@@ -152,7 +158,7 @@ def init_connection(remote_cmd):
def check_connection_version(conn, remote_cmd):
"""Log warning if connection has different version"""
try: remote_version = conn.Globals.get('version')
- except connection.ConnectionReadError, exception:
+ except connection.ConnectionError, exception:
Log.FatalError("""%s
Couldn't start up the remote connection by executing
@@ -247,7 +253,7 @@ def test_connection(conn_number):
conn = Globals.connections[conn_number]
try:
assert conn.Globals.get('current_time') is None
- assert type(conn.os.getuid()) is int
+ assert type(conn.os.listdir('.')) is list
version = conn.Globals.get('version')
except:
sys.stderr.write("Server tests failed\n")
diff --git a/rdiff-backup/rdiff_backup/connection.py b/rdiff-backup/rdiff_backup/connection.py
index 2fbe8ea..7799585 100644
--- a/rdiff-backup/rdiff_backup/connection.py
+++ b/rdiff-backup/rdiff_backup/connection.py
@@ -203,7 +203,7 @@ class LowLevelPipeConnection(Connection):
C.long2str(long(len(data))))
self.outpipe.write(data)
self.outpipe.flush()
- except IOError: raise ConnectionWriteError()
+ except (IOError, AttributeError): raise ConnectionWriteError()
def _read(self, length):
"""Read length bytes from inpipe, returning result"""