From ef1e7072902e2998e9f2d0cd4ca87cb273adf742 Mon Sep 17 00:00:00 2001 From: Michael Barton Date: Thu, 12 May 2011 19:07:48 +0000 Subject: [PATCH 1/3] fix ipv6 literals in rsync --- swift/common/db_replicator.py | 4 ++-- swift/obj/replicator.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/swift/common/db_replicator.py b/swift/common/db_replicator.py index 838cfc21df..f9d400d02a 100644 --- a/swift/common/db_replicator.py +++ b/swift/common/db_replicator.py @@ -177,11 +177,11 @@ class Replicator(Daemon): :param replicate_timeout: timeout to wait in seconds """ if self.vm_test_mode: - remote_file = '%s::%s%s/%s/tmp/%s' % (device['ip'], + remote_file = '[%s]::%s%s/%s/tmp/%s' % (device['ip'], self.server_type, device['port'], device['device'], local_id) else: - remote_file = '%s::%s/%s/tmp/%s' % (device['ip'], + remote_file = '[%s]::%s/%s/tmp/%s' % (device['ip'], self.server_type, device['device'], local_id) mtime = os.path.getmtime(broker.db_file) if not self._rsync_file(broker.db_file, remote_file): diff --git a/swift/obj/replicator.py b/swift/obj/replicator.py index 35bbed44cd..c65751e747 100644 --- a/swift/obj/replicator.py +++ b/swift/obj/replicator.py @@ -271,9 +271,9 @@ class ObjectReplicator(Daemon): '--contimeout=%s' % self.rsync_io_timeout, ] if self.vm_test_mode: - rsync_module = '%s::object%s' % (node['ip'], node['port']) + rsync_module = '[%s]::object%s' % (node['ip'], node['port']) else: - rsync_module = '%s::object' % node['ip'] + rsync_module = '[%s]::object' % node['ip'] had_any = False for suffix in suffixes: spath = join(job['path'], suffix) From dc213d9746bc9976c38217d6bfa6ab20654dcd34 Mon Sep 17 00:00:00 2001 From: Michael Barton Date: Fri, 13 May 2011 02:41:37 +0000 Subject: [PATCH 3/3] update unit tests --- test/unit/obj/test_replicator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/obj/test_replicator.py b/test/unit/obj/test_replicator.py index 50dac19559..a99941e07e 100644 --- a/test/unit/obj/test_replicator.py +++ b/test/unit/obj/test_replicator.py @@ -179,7 +179,7 @@ class TestObjectReplicator(unittest.TestCase): self.ring.get_part_nodes(int(cur_part)) \ if node['ip'] not in _ips()] for node in nodes: - rsync_mod = '%s::object/sda/objects/%s' % (node['ip'], cur_part) + rsync_mod = '[%s]::object/sda/objects/%s' % (node['ip'], cur_part) process_arg_checker.append( (0, '', ['rsync', whole_path_from, rsync_mod])) with _mock_process(process_arg_checker): @@ -363,7 +363,7 @@ class TestObjectReplicator(unittest.TestCase): self.ring.get_part_nodes(int(cur_part)) \ if node['ip'] not in _ips()] for node in nodes: - rsync_mod = '%s::object/sda/objects/%s' % (node['ip'], cur_part) + rsync_mod = '[%s]::object/sda/objects/%s' % (node['ip'], cur_part) process_arg_checker.append( (0, '', ['rsync', whole_path_from, rsync_mod])) self.assertTrue(os.access(os.path.join(self.objects,