Signed-off-by: IWASE Yusuke <[email protected]>
---
 ryu/lib/ovs/vsctl.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/ryu/lib/ovs/vsctl.py b/ryu/lib/ovs/vsctl.py
index b82b071..f145498 100644
--- a/ryu/lib/ovs/vsctl.py
+++ b/ryu/lib/ovs/vsctl.py
@@ -266,8 +266,13 @@ class VSCtlContext(object):
 
     def add_port_to_cache(self, vsctl_bridge_parent, ovsrec_port):
         tag = getattr(ovsrec_port, vswitch_idl.OVSREC_PORT_COL_TAG, None)
-        if tag is not None and tag != [] and 0 <= tag < 4096:
-            vlan_bridge = vsctl_bridge_parent.find_vlan_bridge()
+        if isinstance(tag, list):
+            if len(tag) == 0:
+                tag = 0
+            else:
+                tag = tag[0]
+        if tag is not None and 0 <= tag < 4096:
+            vlan_bridge = vsctl_bridge_parent.find_vlan_bridge(tag)
             if vlan_bridge:
                 vsctl_bridge_parent = vlan_bridge
 
-- 
2.7.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to