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/298993 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=90b9cd334b1 b33df933bf1b61b 38c6e087c431af
Committed: https:/
Submitter: Jenkins
Branch: stable/mitaka
commit 90b9cd334b1b33d f933bf1b61b38c6 e087c431af
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