Merge "Remove useless tests and TODOes for internet gateway"
This commit is contained in:
commit
e4f264e6af
|
@ -76,8 +76,7 @@ def attach_internet_gateway(context, internet_gateway_id, vpc_id):
|
|||
os_networks = neutron.list_networks(**search_opts)['networks']
|
||||
os_public_network = os_networks[0]
|
||||
|
||||
# TODO(ft):
|
||||
# set attaching state in db
|
||||
# TODO(ft): set attaching state into db
|
||||
with common.OnCrashCleaner() as cleaner:
|
||||
_attach_internet_gateway_item(context, igw, vpc['id'])
|
||||
cleaner.addCleanup(_detach_internet_gateway_item, context, igw)
|
||||
|
@ -94,8 +93,7 @@ def detach_internet_gateway(context, internet_gateway_id, vpc_id):
|
|||
vpc_id=vpc['id'])
|
||||
|
||||
neutron = clients.neutron(context)
|
||||
# TODO(ft):
|
||||
# set detaching state in db
|
||||
# TODO(ft): set detaching state into db
|
||||
with common.OnCrashCleaner() as cleaner:
|
||||
_detach_internet_gateway_item(context, igw)
|
||||
cleaner.addCleanup(_attach_internet_gateway_item,
|
||||
|
@ -103,9 +101,6 @@ def detach_internet_gateway(context, internet_gateway_id, vpc_id):
|
|||
try:
|
||||
neutron.remove_gateway_router(vpc["os_id"])
|
||||
except neutron_exception.NotFound:
|
||||
# TODO(ft): do log error
|
||||
# TODO(ft): adjust catched exception classes to catch:
|
||||
# the router doesn't exist
|
||||
pass
|
||||
return True
|
||||
|
||||
|
@ -143,8 +138,11 @@ def _format_internet_gateway(igw):
|
|||
ec2_igw = {'internetGatewayId': igw['id'],
|
||||
'attachmentSet': []}
|
||||
if igw.get('vpc_id'):
|
||||
# NOTE(ft): AWS actually returns 'available' state rather than
|
||||
# documented 'attached' one
|
||||
attachment_state = 'available'
|
||||
attachment = {'vpcId': igw['vpc_id'],
|
||||
'state': 'available'}
|
||||
'state': attachment_state}
|
||||
ec2_igw['attachmentSet'].append(attachment)
|
||||
return ec2_igw
|
||||
|
||||
|
|
|
@ -42,10 +42,6 @@ class IgwTestCase(base.ApiTestCase):
|
|||
self.db_api.add_item.assert_called_with(
|
||||
mock.ANY, 'igw', {})
|
||||
|
||||
@base.skip_not_implemented
|
||||
def test_create_igw_overlimit(self):
|
||||
pass
|
||||
|
||||
def test_attach_igw(self):
|
||||
conf = cfg.CONF
|
||||
self.addCleanup(conf.reset)
|
||||
|
@ -247,8 +243,8 @@ class IgwTestCase(base.ApiTestCase):
|
|||
def do_check(error_code):
|
||||
resp = self.execute(
|
||||
'DeleteInternetGateway',
|
||||
{'InternetGatewayId':
|
||||
fakes.EC2_IGW_1['internetGatewayId']})
|
||||
{'InternetGatewayId': (
|
||||
fakes.EC2_IGW_1['internetGatewayId'])})
|
||||
|
||||
self.assertEqual(400, resp['http_status_code'])
|
||||
self.assertEqual(error_code, resp['Error']['Code'])
|
||||
|
@ -290,11 +286,3 @@ class IgwTestCase(base.ApiTestCase):
|
|||
self.check_tag_support(
|
||||
'DescribeInternetGateways', 'internetGatewaySet',
|
||||
fakes.ID_EC2_IGW_2, 'internetGatewayId')
|
||||
|
||||
@base.skip_not_implemented
|
||||
def test_describe_igw_no_vpc(self):
|
||||
pass
|
||||
|
||||
@base.skip_not_implemented
|
||||
def test_describe_igw_is_attached_to_broken_vpc(self):
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue