Provide fallback for disabled port security extension

The push notification logic always assumed the port security object
would exist but it is not present on the port when the extension is
disabled. This defaults it to true like the server side code.[1]

1.
c430e9b8d4/neutron/plugins/ml2/rpc.py (L142)

Change-Id: Ice89ad9dd486ad5fcac534ef5f7d8aae3b6b0f97
Closes-Bug: #1694420
This commit is contained in:
Kevin Benton 2017-05-30 21:38:45 -07:00 committed by Ihar Hrachyshka
parent 6cfe39708f
commit 817f39e495
1 changed files with 2 additions and 1 deletions

View File

@ -254,7 +254,8 @@ class CacheBackedPluginApi(PluginApi):
'allowed_address_pairs': [{'mac_address': o.mac_address,
'ip_address': o.ip_address}
for o in port_obj.allowed_address_pairs],
'port_security_enabled': port_obj.security.port_security_enabled,
'port_security_enabled': getattr(port_obj.security,
'port_security_enabled', True),
'qos_policy_id': port_obj.qos_policy_id,
'network_qos_policy_id': net_qos_policy_id,
'profile': port_obj.binding.profile,