Merge "Rename scenario.manager._create_port to create_port"

This commit is contained in:
Zuul 2017-10-18 22:09:49 +00:00 committed by Gerrit Code Review
commit 213f213d44
2 changed files with 7 additions and 10 deletions

View File

@ -89,16 +89,14 @@ class ScenarioTest(tempest.test.BaseTestCase):
# The create_[resource] functions only return body and discard the
# resp part which is not used in scenario tests
def _create_port(self, network_id, client=None, namestart='port-quotatest',
**kwargs):
def create_port(self, network_id, client=None, **kwargs):
if not client:
client = self.ports_client
name = data_utils.rand_name(namestart)
name = data_utils.rand_name(self.__class__.__name__)
result = client.create_port(
name=name,
network_id=network_id,
**kwargs)
self.assertIsNotNone(result, 'Unable to allocate port')
port = result['port']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
client.delete_port, port['id'])
@ -147,8 +145,7 @@ class ScenarioTest(tempest.test.BaseTestCase):
if vnic_type:
ports = []
create_port_body = {'binding:vnic_type': vnic_type,
'namestart': 'port-smoke'}
create_port_body = {'binding:vnic_type': vnic_type}
if kwargs:
# Convert security group names to security group ids
# to pass to create_port
@ -185,9 +182,9 @@ class ScenarioTest(tempest.test.BaseTestCase):
for net in networks:
net_id = net.get('uuid', net.get('id'))
if 'port' not in net:
port = self._create_port(network_id=net_id,
client=clients.ports_client,
**create_port_body)
port = self.create_port(network_id=net_id,
client=clients.ports_client,
**create_port_body)
ports.append({'port': port['id']})
else:
ports.append({'port': net['port']})

View File

@ -113,7 +113,7 @@ class TestNetworkBasicOps(manager.NetworkScenarioTest):
port_id = None
if boot_with_port:
# create a port on the network and boot with that
port_id = self._create_port(self.network['id'])['id']
port_id = self.create_port(self.network['id'])['id']
self.ports.append({'port': port_id})
server = self._create_server(self.network, port_id)