From 0bd87945619baeee86b344afd02b1b502fc72542 Mon Sep 17 00:00:00 2001 From: Gurucharan Shetty Date: Wed, 10 Sep 2014 10:32:26 -0700 Subject: [PATCH] ovs-vtep: Handle physical ports with '-' in its name. As of now, if a physical port has a '-' in its name, ovs-vtep throws a ValueError exception. This patch fixes the problem. Reported-by: Mark Maglana Signed-off-by: Gurucharan Shetty --- vtep/ovs-vtep | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vtep/ovs-vtep b/vtep/ovs-vtep index 721063b3e..ea233e0cb 100755 --- a/vtep/ovs-vtep +++ b/vtep/ovs-vtep @@ -288,7 +288,9 @@ class Logical_Switch(object): for interface in self.ports.iterkeys(): if not interface.endswith("-l"): continue - vlan, pp_name, logical = interface.split("-") + # Physical ports can have a '-' as part of its name. + vlan, remainder = interface.split("-", 1) + pp_name, logical = remainder.rsplit("-", 1) uuid = vtep_ctl("get physical_port %s vlan_stats:%s" % (pp_name, vlan)) if not uuid: @@ -308,7 +310,7 @@ class Logical_Switch(object): def add_binding(ps_name, binding, ls): vlog.info("adding binding %s" % binding) - vlan, pp_name = binding.split("-") + vlan, pp_name = binding.split("-", 1) pbinding = binding+"-p" lbinding = binding+"-l" -- 2.20.1