Cases where there are multiple Open_vSwitch rows would cause
the method to not find a match. The method should loop through
all the rows until a match is found, but an early break was causing
the method to exit after the first row is processed.
Change-Id: I624bbd2aeede7c99bad62d1c5356bcf2af1dd0c8
Signed-off-by: Sam Hague <shague@redhat.com>
* 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) {
}
}
}
- break;
+
+ if (phyIf != null) {
+ break;
+ }
}
} catch (Exception e) {
logger.error("Unable to find physical interface for Node: {}, Network {}",