port security: gracefully handle resources with no bindings
Resources could be created before the extension was enabled in the
setup. In that case, no bindings are created for them. In that case, we
should gracefully return default (True) value when extracting the value
using the mixin; and we should also create binding model on update
request, if there is no existing binding model for the resource.
While at it, introduced a constant to store the default value for port
security (True) and changed several tests to use the constant instead of
extracting it from extension resource map.
Change-Id: I8607cdecdc16c5f94635c94e2f02700c732806eb
Closes-Bug: #1509312
(cherry picked from commit b0519cf0ada3b3d9b76f84948f9ad3c142fc50be)
Reviewed: https:/ /review. openstack. org/299204 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=d1618c91075 e32b1d3f58869b0 2065f4e0709c49
Committed: https:/
Submitter: Jenkins
Branch: stable/liberty
commit d1618c91075e32b 1d3f58869b02065 f4e0709c49
Author: Ihar Hrachyshka <email address hidden>
Date: Thu Mar 17 16:20:52 2016 +0100
port security: gracefully handle resources with no bindings
Resources could be created before the extension was enabled in the
setup. In that case, no bindings are created for them. In that case, we
should gracefully return default (True) value when extracting the value
using the mixin; and we should also create binding model on update
request, if there is no existing binding model for the resource.
While at it, introduced a constant to store the default value for port
security (True) and changed several tests to use the constant instead of
extracting it from extension resource map.
Change-Id: I8607cdecdc16c5 f94635c94e2f027 00c732806eb 9b76f84948f9ad3 c142fc50be)
Closes-Bug: #1509312
(cherry picked from commit b0519cf0ada3b3d