Fixed bugs in filtering and routing
Change-Id: Idcf928e3887b20d6bd0636747a02ab43bc1cf812
This commit is contained in:
parent
ed62986f2f
commit
e7b38152ff
@ -295,7 +295,11 @@ class UniversalDescriber(object):
|
|||||||
reason='invalid filter')
|
reason='invalid filter')
|
||||||
if isinstance(filter_name, list):
|
if isinstance(filter_name, list):
|
||||||
value_set = item.get(filter_name[0], [])
|
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:
|
else:
|
||||||
value = item.get(filter_name)
|
value = item.get(filter_name)
|
||||||
values = [value] if value else []
|
values = [value] if value else []
|
||||||
|
@ -155,7 +155,7 @@ def replace_route_table_association(context, association_id, route_table_id):
|
|||||||
context, subnet, route_table, cleaner=cleaner,
|
context, subnet, route_table, cleaner=cleaner,
|
||||||
rollback_route_table_object=rollabck_route_table_object)
|
rollback_route_table_object=rollabck_route_table_object)
|
||||||
|
|
||||||
return {'associationId': association_id}
|
return {'newAssociationId': association_id}
|
||||||
|
|
||||||
|
|
||||||
def disassociate_route_table(context, association_id):
|
def disassociate_route_table(context, association_id):
|
||||||
|
@ -446,7 +446,7 @@ class RouteTableTestCase(base.ApiTestCase):
|
|||||||
'RouteTableId': fakes.ID_EC2_ROUTE_TABLE_2})
|
'RouteTableId': fakes.ID_EC2_ROUTE_TABLE_2})
|
||||||
self.assertEqual(200, resp['http_status_code'])
|
self.assertEqual(200, resp['http_status_code'])
|
||||||
self.assertEqual(fakes.ID_EC2_ROUTE_TABLE_ASSOCIATION_2,
|
self.assertEqual(fakes.ID_EC2_ROUTE_TABLE_ASSOCIATION_2,
|
||||||
resp['associationId'])
|
resp['newAssociationId'])
|
||||||
subnet = tools.update_dict(
|
subnet = tools.update_dict(
|
||||||
subnet,
|
subnet,
|
||||||
{'route_table_id': fakes.ID_EC2_ROUTE_TABLE_2})
|
{'route_table_id': fakes.ID_EC2_ROUTE_TABLE_2})
|
||||||
@ -469,7 +469,7 @@ class RouteTableTestCase(base.ApiTestCase):
|
|||||||
'RouteTableId': fakes.ID_EC2_ROUTE_TABLE_2})
|
'RouteTableId': fakes.ID_EC2_ROUTE_TABLE_2})
|
||||||
self.assertEqual(200, resp['http_status_code'])
|
self.assertEqual(200, resp['http_status_code'])
|
||||||
self.assertEqual(fakes.ID_EC2_ROUTE_TABLE_ASSOCIATION_1,
|
self.assertEqual(fakes.ID_EC2_ROUTE_TABLE_ASSOCIATION_1,
|
||||||
resp['associationId'])
|
resp['newAssociationId'])
|
||||||
vpc = tools.update_dict(
|
vpc = tools.update_dict(
|
||||||
fakes.DB_VPC_1,
|
fakes.DB_VPC_1,
|
||||||
{'route_table_id': fakes.ID_EC2_ROUTE_TABLE_2})
|
{'route_table_id': fakes.ID_EC2_ROUTE_TABLE_2})
|
||||||
|
Loading…
Reference in New Issue
Block a user