]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
portsecurity_db: Use is_attr_set instead of a home-grown equivalent
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Mon, 9 Mar 2015 08:31:27 +0000 (17:31 +0900)
committerYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Mon, 9 Mar 2015 08:32:04 +0000 (17:32 +0900)
Change-Id: I72003a856315067105bbb2b764b8b608a393cd42

neutron/db/portsecurity_db.py

index 14423a46f300e20d526fff407c73d873a78a923f..408950b814a70c8bdb3a559cee03249df2ad88fd 100644 (file)
@@ -154,8 +154,7 @@ class PortSecurityDbMixin(object):
                 port['device_owner'].startswith('network:')):
             return (False, has_ip)
 
-        if (psec.PORTSECURITY in port and
-            isinstance(port[psec.PORTSECURITY], bool)):
+        if attrs.is_attr_set(port.get(psec.PORTSECURITY)):
             port_security_enabled = port[psec.PORTSECURITY]
 
         # If port has an ip and security_groups are passed in