use of org.onosproject.openstacknode.api.Constants.BRIDGE_PREFIX in project onos by opennetworkinglab.
the class DefaultOpenstackNodeHandler method cleanPhysicalInterfaces.
private void cleanPhysicalInterfaces(OpenstackNode osNode) {
Device device = deviceService.getDevice(osNode.ovsdb());
BridgeConfig bridgeConfig = device.as(BridgeConfig.class);
Set<String> bridgeNames = bridgeConfig.getBridges().stream().map(BridgeDescription::name).collect(Collectors.toSet());
Set<String> phyNetworkNames = osNode.phyIntfs().stream().map(pi -> BRIDGE_PREFIX + pi.network()).collect(Collectors.toSet());
// we remove existing physical bridges and patch ports, if the physical
// bridges are not defined in openstack node
bridgeNames.forEach(brName -> {
if (!phyNetworkNames.contains(brName) && !brName.equals(INTEGRATION_BRIDGE)) {
removePhysicalPatchPorts(osNode, brName.substring(NETWORK_BEGIN));
removePhysicalBridge(osNode, brName.substring(NETWORK_BEGIN));
}
});
}
Aggregations