Fix regression in RetryFilter

Fixes regression in RetryFilter.  The RPC layer would convert the list
of tuples that comprised the previously attempted hosts to a list of
lists.  The RetryFilter was attempting to compare a tuple to a list,
which failed.

bug 1096196

Change-Id: I30adf42daf5e86ccec0269eca1f84d06ed4beb59
This commit is contained in:
Brian Elliott
2013-01-04 20:46:17 +00:00
parent 48487f1a4b
commit a62f01a1ab
4 changed files with 14 additions and 11 deletions

View File

@@ -1272,8 +1272,8 @@ class HostFiltersTestCase(test.TestCase):
filt_cls = self.class_map['RetryFilter']()
host = fakes.FakeHostState('host1', 'nodeX', {})
retry = dict(num_attempts=2,
hosts=[('host1', 'node1'), # same host, different node
('host2', 'node2'), # different host and node
hosts=[['host1', 'node1'], # same host, different node
['host2', 'node2'], # different host and node
])
filter_properties = dict(retry=retry)
self.assertTrue(filt_cls.host_passes(host, filter_properties))
@@ -1283,7 +1283,7 @@ class HostFiltersTestCase(test.TestCase):
filt_cls = self.class_map['RetryFilter']()
host = fakes.FakeHostState('host1', 'node1', {})
retry = dict(num_attempts=1,
hosts=[('host1', 'node1')])
hosts=[['host1', 'node1']])
filter_properties = dict(retry=retry)
self.assertFalse(filt_cls.host_passes(host, filter_properties))