use of org.openkilda.wfm.topology.switchmanager.error.InconsistentDataException in project open-kilda by telstra.
the class CreateLagPortFsm method createLagInDb.
void createLagInDb(CreateLagState from, CreateLagState to, CreateLagEvent event, CreateLagContext context) {
log.info("Creating LAG {} on switch {}. Key={}", request, switchId, key);
try {
HashSet<Integer> targetPorts = new HashSet<>(request.getPortNumbers());
lagLogicalPortNumber = lagPortOperationService.createLagPort(switchId, targetPorts);
String ipAddress = lagPortOperationService.getSwitchIpAddress(switchId);
grpcRequest = new CreateLogicalPortRequest(ipAddress, request.getPortNumbers(), lagLogicalPortNumber, LAG);
} catch (InvalidDataException | InconsistentDataException | SwitchNotFoundException e) {
log.error(format("Unable to handle %s. Error: %s", request, e.getMessage()), e);
fire(ERROR, CreateLagContext.builder().error(e).build());
}
}
use of org.openkilda.wfm.topology.switchmanager.error.InconsistentDataException in project open-kilda by telstra.
the class DeleteLagPortFsm method createGrpcRequest.
void createGrpcRequest(DeleteLagState from, DeleteLagState to, DeleteLagEvent event, DeleteLagContext context) {
log.info("Removing LAG {} on switch {}. Key={}", request, switchId, key);
try {
lagPortOperationService.ensureDeleteIsPossible(switchId, request.getLogicalPortNumber());
String ipAddress = lagPortOperationService.getSwitchIpAddress(switchId);
grpcRequest = new DeleteLogicalPortRequest(ipAddress, request.getLogicalPortNumber());
} catch (LagPortNotFoundException | InvalidDataException | SwitchNotFoundException | InconsistentDataException e) {
log.error(format("Unable to delete LAG logical port %d on switch %s. Error: %s", request.getLogicalPortNumber(), switchId, e.getMessage()), e);
fire(ERROR, DeleteLagContext.builder().error(e).build());
}
}
Aggregations