From: Ravi Shekhar Jethani Date: Thu, 19 Nov 2015 10:02:31 +0000 (-0800) Subject: ML2: Simplified boolean variable check X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=8d2b15e42353ea67db22266d5545da68debe19f8;p=openstack-build%2Fneutron-build.git ML2: Simplified boolean variable check Currently 'flows' is being checked for empty list in a non standard way 'if flows == []:'. This patch simplifies logic so that above check is unnecessary. TrivialFix Change-Id: I0eac42e425213b6588090e7e2379b14446308361 --- diff --git a/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/br_int.py b/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/br_int.py index 2c4bd47f1..e7bfb0dcf 100644 --- a/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/br_int.py +++ b/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/br_int.py @@ -51,9 +51,7 @@ class OVSIntegrationBridge(ovs_bridge.OVSAgentBridge): except RuntimeError: LOG.exception(_LE("Failed to communicate with the switch")) return constants.OVS_DEAD - if flows == []: - return constants.OVS_RESTARTED - return constants.OVS_NORMAL + return constants.OVS_NORMAL if flows else constants.OVS_RESTARTED @staticmethod def _local_vlan_match(_ofp, ofpp, port, vlan_vid):