diff options
author | Rex Lee <limingjiang@huawei.com> | 2017-07-28 01:12:14 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-07-28 01:12:14 +0000 |
commit | cf68baf48f43ebb70b1fb137fd4f1a5bbbc1e0df (patch) | |
tree | 026de6b3cf7d5989f04adbd61084f0a4fe62228b | |
parent | 9000303d8df63f8d846b28c67ce1b45f16bb6c8b (diff) | |
parent | 1767ce92c455008298d0ffe5b71fa3bdc1dd8d2b (diff) |
Merge "leave port_security_enabled undefined by default"
-rw-r--r-- | yardstick/benchmark/contexts/model.py | 2 | ||||
-rw-r--r-- | yardstick/orchestrator/heat.py | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/yardstick/benchmark/contexts/model.py b/yardstick/benchmark/contexts/model.py index 6601ecf3b..ec474321f 100644 --- a/yardstick/benchmark/contexts/model.py +++ b/yardstick/benchmark/contexts/model.py @@ -110,7 +110,7 @@ class Network(Object): self.provider = attrs.get('provider') self.segmentation_id = attrs.get('segmentation_id') self.network_type = attrs.get('network_type') - self.port_security_enabled = attrs.get('port_security_enabled', True) + self.port_security_enabled = attrs.get('port_security_enabled') self.allowed_address_pairs = attrs.get('allowed_address_pairs', []) try: # we require 'null' or '' to disable setting gateway_ip diff --git a/yardstick/orchestrator/heat.py b/yardstick/orchestrator/heat.py index 57b23d393..95ca0ad2e 100644 --- a/yardstick/orchestrator/heat.py +++ b/yardstick/orchestrator/heat.py @@ -231,7 +231,7 @@ name (i.e. %s).\ } def add_network(self, name, physical_network='physnet1', provider=None, - segmentation_id=None, port_security_enabled=True): + segmentation_id=None, port_security_enabled=None): """add to the template a Neutron Net""" log.debug("adding Neutron::Net '%s'", name) if provider is None: @@ -239,7 +239,6 @@ name (i.e. %s).\ 'type': 'OS::Neutron::Net', 'properties': { 'name': name, - 'port_security_enabled': port_security_enabled, } } else: @@ -249,11 +248,14 @@ name (i.e. %s).\ 'name': name, 'network_type': 'vlan', 'physical_network': physical_network, - 'port_security_enabled': port_security_enabled, }, } if segmentation_id: self.resources[name]['properties']['segmentation_id'] = segmentation_id + # if port security is not defined then don't add to template: + # some deployments don't have port security plugin installed + if port_security_enabled is not None: + self.resources[name]['properties']['port_security_enabled'] = port_security_enabled def add_server_group(self, name, policies): # pragma: no cover """add to the template a ServerGroup""" |