diff options
author | owsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2009-03-27 21:31:11 +0000 |
---|---|---|
committer | owsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2009-03-27 21:31:11 +0000 |
commit | 336f5ebeadaa05b01b6756c4a9424e5000861d2e (patch) | |
tree | 00e21d49dc6b29402b86ec6ba90ccb6bd62107ed | |
parent | 9a3563a655f2f094c449794e65fb25507644bb4c (diff) | |
download | rdiff-backup-336f5ebeadaa05b01b6756c4a9424e5000861d2e.tar.gz |
Allow --test-server to be used with --restrict again.
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@1050 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r-- | rdiff-backup/CHANGELOG | 7 | ||||
-rw-r--r-- | rdiff-backup/rdiff_backup/Main.py | 2 | ||||
-rw-r--r-- | rdiff-backup/rdiff_backup/SetConnections.py | 13 |
3 files changed, 17 insertions, 5 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG index 57e59c8..7a654c5 100644 --- a/rdiff-backup/CHANGELOG +++ b/rdiff-backup/CHANGELOG @@ -1,3 +1,10 @@ +New in v1.3.4 (????/??/??) +--------------------------- + +Allow --test-server option to be combined with --restrict. Thanks to Nick +Moffitt for reporting the error. Closes Ubuntu bug #349072. (Andrew Ferguson) + + New in v1.3.3 (2009/03/16) --------------------------- diff --git a/rdiff-backup/rdiff_backup/Main.py b/rdiff-backup/rdiff_backup/Main.py index d111dc9..a8bc1dc 100644 --- a/rdiff-backup/rdiff_backup/Main.py +++ b/rdiff-backup/rdiff_backup/Main.py @@ -290,7 +290,7 @@ def take_action(rps): elif action == "remove-older-than": RemoveOlderThan(rps[0]) elif action == "restore": Restore(*rps) elif action == "restore-as-of": Restore(rps[0], rps[1], 1) - elif action == "test-server": SetConnections.TestConnections() + elif action == "test-server": SetConnections.TestConnections(rps) elif action == "verify": Verify(rps[0]) else: raise AssertionError("Unknown action " + action) diff --git a/rdiff-backup/rdiff_backup/SetConnections.py b/rdiff-backup/rdiff_backup/SetConnections.py index d4e1a59..793674c 100644 --- a/rdiff-backup/rdiff_backup/SetConnections.py +++ b/rdiff-backup/rdiff_backup/SetConnections.py @@ -241,19 +241,24 @@ def CloseConnections(): Globals.backup_reader = Globals.isbackup_reader = \ Globals.backup_writer = Globals.isbackup_writer = None -def TestConnections(): +def TestConnections(rpaths): """Test connections, printing results""" if len(Globals.connections) == 1: print "No remote connections specified" else: - for i in range(1, len(Globals.connections)): test_connection(i) + assert len(Globals.connection) == len(rpaths) + 1 + for i in range(1, len(Globals.connections)): + test_connection(i, rpaths[i-1]) -def test_connection(conn_number): +def test_connection(conn_number, rp): """Test connection. conn_number 0 is the local connection""" print "Testing server started by: ", __conn_remote_cmds[conn_number] conn = Globals.connections[conn_number] try: assert conn.Globals.get('current_time') is None - assert type(conn.os.listdir('.')) is list + try: + assert type(conn.os.getuid()) is int + except AttributeError: # Windows doesn't support os.getuid() + assert type(conn.os.listdir(rp.path)) is list version = conn.Globals.get('version') except: sys.stderr.write("Server tests failed\n") |