Use config_number method instead of node_id + 1

Change-Id: I596a2ac947f7e5f9c0cb3286779ece5e40feefd0
This commit is contained in:
Kota Tsuyuzaki 2017-06-07 00:44:41 -07:00
parent 8d6eb36779
commit c23b6db264

View File

@ -396,11 +396,11 @@ class TestContainerMergePolicyIndex(ReplProbeTest):
(node, direct_client.direct_head_container( (node, direct_client.direct_head_container(
node, container_part, self.account, self.container_name)) node, container_part, self.account, self.container_name))
for node in container_nodes] for node in container_nodes]
old_container_node_ids = [ old_container_nodes = [
node['id'] for node, metadata in head_responses node for node, metadata in head_responses
if int(old_policy) == if int(old_policy) ==
int(metadata['X-Backend-Storage-Policy-Index'])] int(metadata['X-Backend-Storage-Policy-Index'])]
self.assertEqual(2, len(old_container_node_ids)) self.assertEqual(2, len(old_container_nodes))
# hopefully memcache still has the new policy cached # hopefully memcache still has the new policy cached
self.brain.put_object(headers={'x-object-meta-test': 'custom-meta'}, self.brain.put_object(headers={'x-object-meta-test': 'custom-meta'},
@ -425,7 +425,8 @@ class TestContainerMergePolicyIndex(ReplProbeTest):
# and get rows enqueued from old nodes # and get rows enqueued from old nodes
for server_type in ('container-replicator', 'container-updater'): for server_type in ('container-replicator', 'container-updater'):
server = Manager([server_type]) server = Manager([server_type])
tuple(server.once(number=n + 1) for n in old_container_node_ids) for node in old_container_nodes:
server.once(number=self.config_number(node))
# verify entry in the queue for the "misplaced" new_policy # verify entry in the queue for the "misplaced" new_policy
for container in int_client.iter_containers('.misplaced_objects'): for container in int_client.iter_containers('.misplaced_objects'):