Merge "getPhysicalInterfaceName not finding match in some cases"
authorMadhu Venugopal <mavenugo@gmail.com>
Thu, 22 May 2014 22:50:48 +0000 (22:50 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 22 May 2014 22:50:48 +0000 (22:50 +0000)
neutron/src/main/java/org/opendaylight/ovsdb/neutron/AdminConfigManager.java

index 306c661c58360edd236203782ecdf5156899479c..cc108fe1e55a211efe4da49c696d90b77685bed5 100644 (file)
@@ -152,10 +152,10 @@ public class AdminConfigManager implements IAdminConfigManager{
      * provider_mappings=physnet1:eth1[,physnet2:eth2]
      */
       public String getPhysicalInterfaceName (Node node, String physicalNetwork) {
-        String phyIf = null;
+          String phyIf = null;
 
-        try {
-            OVSDBConfigService ovsdbConfig = (OVSDBConfigService) ServiceHelper.getGlobalInstance(OVSDBConfigService.class, this);
+          OVSDBConfigService ovsdbConfig = (OVSDBConfigService) ServiceHelper.getGlobalInstance(OVSDBConfigService.class, this);
+          try {
             Map<String, Table<?>> ovsTable = ovsdbConfig.getRows(node, Open_vSwitch.NAME.getName());
 
             if (ovsTable == null) {
@@ -189,7 +189,10 @@ public class AdminConfigManager implements IAdminConfigManager{
                         }
                     }
                 }
-                break;
+
+                if (phyIf != null) {
+                    break;
+                }
             }
         } catch (Exception e) {
             logger.error("Unable to find physical interface for Node: {}, Network {}",