BUG:8761 Portmapping fails due to unnecessary hex conversion 80/60180/2
authoryogalakshmi.pa <yogalakshmi.pa@hcl.com>
Tue, 11 Jul 2017 20:13:47 +0000 (16:13 -0400)
committerYOGA LAKSHMI SWETHA PAYYAVULA <yogalakshmi.pa@hcl.com>
Fri, 14 Jul 2017 06:31:36 +0000 (06:31 +0000)
  * The VTN coordinator implementation is performing an
  operation to convert the switch ID to hexadecimal and
  then invoking VTN Manager REST API for creating port map.
  * Due to this the portmap creation fails when the logical
  port-id value is greater than nine
  * This was required for VTN in the Li release. But, later
  VTN Manager migrated to MD-SAL, after which this conversion
  was not necessary.

Change-Id: I8d84179442284101fa3b9033ed85c207042f9db0
Signed-off-by: yogalakshmi.pa <yogalakshmi.pa@hcl.com>
coordinator/modules/odcdriver/odc_vbrif.cc

index 2cb1548e2059a8181bff6706cc0fd057700dbbeb..1296adf2c8e2fca7f69656880044b1adecf39659 100644 (file)
@@ -109,14 +109,8 @@ UncRespCode OdcVbrIfCommand::create_request_body_port_map(
   pfc_log_debug("logical_port_id is %s", logical_port_id.c_str());
   std::string switch_port = logical_port_id.substr(3);
   size_t hyphen_occurence = switch_port.find("-");
-  std::string of_switch_id = switch_port.substr(0, hyphen_occurence);
+  switch_id = switch_port.substr(0, hyphen_occurence);
   port_name = switch_port.substr(hyphen_occurence+1);
-  // convert switch id from unsigned decimal to hex string
-  int switch_val = atoi(of_switch_id.substr(9).c_str());
-  std::stringstream stream;
-  stream << std::hex << switch_val;
-  switch_id = stream.str();
-  switch_id = SWITCH_BASE + switch_id ;
   pfc_log_debug("port name : %s", port_name.c_str());
   pfc_log_debug("switch id : %s", switch_id.c_str());
   //ip_vbrif_port_st.input_vbrifport_.vlan = 0;