Fixed a minor bug that causes the deprecated CSIT Integration Bridge Domain addPort... 19/10519/2
authorMadhu Venugopal <mavenugo@gmail.com>
Sat, 30 Aug 2014 16:40:25 +0000 (09:40 -0700)
committerMadhu Venugopal <mavenugo@gmail.com>
Sat, 30 Aug 2014 19:46:06 +0000 (12:46 -0700)
Change-Id: If17a4de8d0832c31de4fb8d5ee38cfe353c0d326
Signed-off-by: Madhu Venugopal <mavenugo@gmail.com>
plugin/src/main/java/org/opendaylight/ovsdb/plugin/impl/ConfigurationServiceImpl.java

index 90e02948f7f502108e445f7df67d600d46870821..7ec44f16bb133dedf09c1fdabeac5ccc4c1c7370 100644 (file)
@@ -989,7 +989,7 @@ public class ConfigurationServiceImpl implements IPluginInBridgeDomainConfigServ
             return new Status(StatusCode.NOTFOUND);
         }
         for (String intfUuid : intfRows.keySet()) {
-            Row intfRow = rows.get(intfUuid);
+            Row intfRow = intfRows.get(intfUuid);
             interfaceRow = client.getTypedRowWrapper(Interface.class, intfRow);
             if (interfaceRow == null || interfaceRow.getName() == null) continue;
             if (interfaceRow.getName().equals(portIdentifier)) break;
@@ -997,25 +997,25 @@ public class ConfigurationServiceImpl implements IPluginInBridgeDomainConfigServ
         if (interfaceRow.getName() == null || !interfaceRow.getName().equals(portIdentifier)) {
             return new Status(StatusCode.NOTFOUND);
         }
-
+        Interface updateInterface = client.createTypedRowWrapper(Interface.class);
         if (type != null) {
             logger.debug("Interface type : " + type);
             if (type.equalsIgnoreCase(OvsVswitchdSchemaConstants.PortType.TUNNEL.name())) {
-                interfaceRow.setType((String)configs.get(ConfigConstants.TUNNEL_TYPE));
+                updateInterface.setType((String)configs.get(ConfigConstants.TUNNEL_TYPE));
                 if (options == null) options = new HashMap<String, String>();
                 options.put("remote_ip", (String)configs.get(ConfigConstants.DEST_IP));
             } else if (type.equalsIgnoreCase(OvsVswitchdSchemaConstants.PortType.PATCH.name()) ||
                        type.equalsIgnoreCase(OvsVswitchdSchemaConstants.PortType.INTERNAL.name())) {
-                interfaceRow.setType(type.toLowerCase());
+                updateInterface.setType(type.toLowerCase());
             }
         }
         if (options != null) {
-            interfaceRow.setOptions(options);
+            updateInterface.setOptions(options);
         }
 
         Status intfStatus = null;
         intfStatus = this.updateRow(node, interfaceRow.getSchema().getName(), portStatus.getUuid().toString(),
-                                    interfaceRow.getUuid().toString(), interfaceRow.getRow());
+                                    interfaceRow.getUuid().toString(), updateInterface.getRow());
 
         if (intfStatus.isSuccess()) return portStatus;
         return intfStatus;
@@ -1069,8 +1069,8 @@ public class ConfigurationServiceImpl implements IPluginInBridgeDomainConfigServ
             return new Status(StatusCode.NOTFOUND);
         }
         for (String portUuid : rows.keySet()) {
-            Row bridgeRow = rows.get(portUuid);
-            port = client.getTypedRowWrapper(Port.class, bridgeRow);
+            Row portRow = rows.get(portUuid);
+            port = client.getTypedRowWrapper(Port.class, portRow);
             if (port.getName().equals(portIdentifier)) break;
         }
         if (port.getName() == null || !port.getName().equals(portIdentifier)) {