Update port profile only if defined

Change[1] added port profile configuration option.
We need to update port only if needed.

[1] https://review.openstack.org/#/c/499575

Change-Id: Ifada5a357d9a09ade7737c5fa8af1422b9353924
This commit is contained in:
Lenny Verkhovsky 2018-02-28 10:19:37 +00:00
parent b9f9f89295
commit fe3a03ff63

View File

@ -141,13 +141,18 @@ class ScenarioTest(tempest.test.BaseTestCase):
vnic_type = CONF.network.port_vnic_type
profile = CONF.network.port_profile
# If vnic_type is configured create port for
# If vnic_type or profile are configured create port for
# every network
if vnic_type:
if vnic_type or profile:
ports = []
create_port_body = {}
if vnic_type:
create_port_body['binding:vnic_type'] = vnic_type
if profile:
create_port_body['binding:profile'] = profile
create_port_body = {'binding:vnic_type': vnic_type,
'binding:profile': profile}
if kwargs:
# Convert security group names to security group ids
# to pass to create_port