Merge "minor fix to https://review.openstack.org/#/c/466115/"
This commit is contained in:
commit
b560a6b88a
|
@ -195,15 +195,14 @@ def _disassociate_address_item(context, address):
|
|||
db_api.update_item(context, address)
|
||||
|
||||
|
||||
def _get_os_instance_id(context, os_floating_ip,
|
||||
os_ports=[]):
|
||||
def _get_os_instance_id(context, os_floating_ip, os_ports=[]):
|
||||
port_id = os_floating_ip.get('port_id')
|
||||
os_instance_id = None
|
||||
if port_id:
|
||||
port = next((port for port in os_ports
|
||||
if port['id'] == port_id), None)
|
||||
if port and port.get('device_id'):
|
||||
os_instance_id = port['device_id']
|
||||
if port:
|
||||
os_instance_id = port.get('device_id')
|
||||
return os_instance_id
|
||||
|
||||
|
||||
|
@ -402,8 +401,7 @@ class AddressEngineNeutron(object):
|
|||
# NOTE(tikitavi): check the public IP exists to raise AWS
|
||||
# exception otherwise
|
||||
os_floating_ip = self.get_os_floating_ip_by_public_ip(
|
||||
context,
|
||||
public_ip)
|
||||
context, public_ip)
|
||||
os_ports = self.get_os_ports(context)
|
||||
os_instance_id = _get_os_instance_id(context, os_floating_ip,
|
||||
os_ports)
|
||||
|
|
|
@ -54,7 +54,6 @@ class AvailabilityZoneCase(base.ApiTestCase):
|
|||
self.assertTrue(resp['regionInfo'][0].get('regionEndpoint')
|
||||
is not None)
|
||||
|
||||
# TODO(tikitavi): Rework test to exclude nova-network
|
||||
@mock.patch('ec2api.api.ec2utils.check_and_create_default_vpc')
|
||||
def test_describe_account_attributes(self, check_and_create):
|
||||
self.nova.quotas.get.return_value = mock.Mock(instances=77)
|
||||
|
|
|
@ -848,10 +848,7 @@ class InstanceTestCase(base.ApiTestCase):
|
|||
'DescribeInstances', ['reservationSet', 'instancesSet'],
|
||||
fakes.ID_EC2_INSTANCE_1, 'instanceId')
|
||||
|
||||
# TODO(tikitavi): Rework test to exclude nova-network
|
||||
def _test_describe_instances_ec2_classic(self):
|
||||
instance_api.instance_engine = (
|
||||
instance_api.InstanceEngineNova())
|
||||
def test_describe_instances_ec2_classic(self):
|
||||
self.set_mock_db_items(
|
||||
fakes.DB_INSTANCE_2, fakes.DB_IMAGE_1, fakes.DB_IMAGE_2,
|
||||
fakes.DB_VOLUME_1, fakes.DB_VOLUME_2, fakes.DB_VOLUME_3)
|
||||
|
|
|
@ -92,7 +92,7 @@ class ProxyTestCase(test_base.BaseTestCase):
|
|||
self.assertEqual(500, response.status_int)
|
||||
self.assertEqual(len(log.mock_calls), 2)
|
||||
|
||||
def _test_get_requester(self):
|
||||
def test_get_requester(self):
|
||||
expected = {'os_instance_id': mock.sentinel.os_instance_id,
|
||||
'project_id': mock.sentinel.project_id,
|
||||
'private_ip': mock.sentinel.private_ip}
|
||||
|
|
|
@ -163,7 +163,6 @@ class SecurityGroupTestCase(base.ApiTestCase):
|
|||
self.neutron.create_security_group.assert_called_once_with(
|
||||
secgroup_body)
|
||||
|
||||
# TODO(tikitavi): Rework test to exclude nova-network
|
||||
@tools.screen_unexpected_exception_logs
|
||||
def test_create_security_group_rollback(self):
|
||||
self.set_mock_db_items(fakes.DB_VPC_1)
|
||||
|
|
Loading…
Reference in New Issue