Merge "Container sync nodes shuffle cleanup"
This commit is contained in:
@@ -18,7 +18,7 @@ import os
|
||||
import uuid
|
||||
from swift import gettext_ as _
|
||||
from time import ctime, time
|
||||
from random import choice, random, shuffle
|
||||
from random import choice, random
|
||||
from struct import unpack_from
|
||||
|
||||
from eventlet import sleep, Timeout
|
||||
@@ -463,11 +463,6 @@ class ContainerSync(Daemon):
|
||||
else:
|
||||
# when sync'ing a live object, use ts_meta - this is the time
|
||||
# at which the source object was last modified by a PUT or POST
|
||||
part, nodes = \
|
||||
self.get_object_ring(info['storage_policy_index']). \
|
||||
get_nodes(info['account'], info['container'],
|
||||
row['name'])
|
||||
shuffle(nodes)
|
||||
exc = None
|
||||
# look up for the newest one
|
||||
headers_out = {'X-Newest': True,
|
||||
|
||||
@@ -854,7 +854,6 @@ class TestContainerSync(unittest.TestCase):
|
||||
|
||||
def _test_container_sync_row_put(self, realm, realm_key):
|
||||
orig_uuid = sync.uuid
|
||||
orig_shuffle = sync.shuffle
|
||||
orig_put_object = sync.put_object
|
||||
try:
|
||||
class FakeUUID(object):
|
||||
@@ -862,7 +861,6 @@ class TestContainerSync(unittest.TestCase):
|
||||
hex = 'abcdef'
|
||||
|
||||
sync.uuid = FakeUUID
|
||||
sync.shuffle = lambda x: x
|
||||
ts_data = Timestamp(1.1)
|
||||
timestamp = Timestamp(1.2)
|
||||
|
||||
@@ -1064,7 +1062,6 @@ class TestContainerSync(unittest.TestCase):
|
||||
self.assertLogMessage('error', 'ERROR Syncing')
|
||||
finally:
|
||||
sync.uuid = orig_uuid
|
||||
sync.shuffle = orig_shuffle
|
||||
sync.put_object = orig_put_object
|
||||
|
||||
def test_select_http_proxy_None(self):
|
||||
|
||||
Reference in New Issue
Block a user