Fixed bugs in filtering and routing

Change-Id: Idcf928e3887b20d6bd0636747a02ab43bc1cf812
This commit is contained in:
alevine 2015-01-23 16:53:04 +04:00
parent ed62986f2f
commit e7b38152ff
4 changed files with 9 additions and 5 deletions

View File

@ -295,7 +295,11 @@ class UniversalDescriber(object):
reason='invalid filter')
if isinstance(filter_name, list):
value_set = item.get(filter_name[0], [])
values = [value[filter_name[1]] for value in value_set]
values = []
for value in value_set:
val = value.get(filter_name[1])
if val is not None:
values.append(val)
else:
value = item.get(filter_name)
values = [value] if value else []

View File

@ -155,7 +155,7 @@ def replace_route_table_association(context, association_id, route_table_id):
context, subnet, route_table, cleaner=cleaner,
rollback_route_table_object=rollabck_route_table_object)
return {'associationId': association_id}
return {'newAssociationId': association_id}
def disassociate_route_table(context, association_id):

View File

@ -136,4 +136,4 @@ class OnCrashCleanerTestCase(test_base.BaseTestCase):
def fake_standalone_crashed_clean_method():
raise Exception()
raise Exception()

View File

@ -446,7 +446,7 @@ class RouteTableTestCase(base.ApiTestCase):
'RouteTableId': fakes.ID_EC2_ROUTE_TABLE_2})
self.assertEqual(200, resp['http_status_code'])
self.assertEqual(fakes.ID_EC2_ROUTE_TABLE_ASSOCIATION_2,
resp['associationId'])
resp['newAssociationId'])
subnet = tools.update_dict(
subnet,
{'route_table_id': fakes.ID_EC2_ROUTE_TABLE_2})
@ -469,7 +469,7 @@ class RouteTableTestCase(base.ApiTestCase):
'RouteTableId': fakes.ID_EC2_ROUTE_TABLE_2})
self.assertEqual(200, resp['http_status_code'])
self.assertEqual(fakes.ID_EC2_ROUTE_TABLE_ASSOCIATION_1,
resp['associationId'])
resp['newAssociationId'])
vpc = tools.update_dict(
fakes.DB_VPC_1,
{'route_table_id': fakes.ID_EC2_ROUTE_TABLE_2})