From 8d2b15e42353ea67db22266d5545da68debe19f8 Mon Sep 17 00:00:00 2001 From: Ravi Shekhar Jethani Date: Thu, 19 Nov 2015 02:02:31 -0800 Subject: [PATCH] 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 --- .../ml2/drivers/openvswitch/agent/openflow/native/br_int.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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): -- 2.45.2