From fe3a03ff6326872cfe965575a531e10f642525ae Mon Sep 17 00:00:00 2001 From: Lenny Verkhovsky Date: Wed, 28 Feb 2018 10:19:37 +0000 Subject: [PATCH] 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 --- tempest/scenario/manager.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py index ef277fb95b..57fb1b2a25 100644 --- a/tempest/scenario/manager.py +++ b/tempest/scenario/manager.py @@ -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