summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
cca7d92)
the port-mapping fails if the xponder subtree is absent
for the entries in connection-map.
This can happen with some devices buggy implementations.
JIRA: TRNSPRTPCE-348
Change-Id: If1a0cb15f8e55038485d75cbe9cdcd826d70c06b
Collection<ConnectionMap> connectionMap = deviceObject.get().nonnullConnectionMap().values();
Collection<ConnectionMap> connectionMap = deviceObject.get().nonnullConnectionMap().values();
- String slcp = null;
- String dlcp = null;
for (ConnectionMap cm : connectionMap) {
for (ConnectionMap cm : connectionMap) {
+ String slcp = null;
+ String dlcp = null;
String skey = cm.getSource().getCircuitPackName() + "+" + cm.getSource().getPortName();
if (lcpMap.containsKey(skey)) {
slcp = lcpMap.get(skey);
String skey = cm.getSource().getCircuitPackName() + "+" + cm.getSource().getPortName();
if (lcpMap.containsKey(skey)) {
slcp = lcpMap.get(skey);
if (lcpMap.containsKey(dkey)) {
dlcp = lcpMap.get(dkey);
}
if (lcpMap.containsKey(dkey)) {
dlcp = lcpMap.get(dkey);
}
- if (slcp != null) {
- Mapping mapping = mappingMap.get(slcp);
- mappingMap.remove(slcp);
- portMapList.add(createXpdrMappingObject(nodeId, null, null, null, null, mapping, dlcp));
- } else {
- LOG.error("Error in connection-map analysis");
+ if (slcp == null) {
+ LOG.error("Error in connection-map analysis for source {} and destination (circuitpack+port) {}",
+ skey, dkey);
+ continue;
+ Mapping mapping = mappingMap.get(slcp);
+ mappingMap.remove(slcp);
+ portMapList.add(createXpdrMappingObject(nodeId, null, null, null, null, mapping, dlcp));
if (!mappingMap.isEmpty()) {
for (Mapping m : mappingMap.values()) {
portMapList.add(m);
if (!mappingMap.isEmpty()) {
for (Mapping m : mappingMap.values()) {
portMapList.add(m);
- if (device.getConnectionMap() != null) {
+ if (device.getConnectionMap() == null) {
+ LOG.warn("No connection-map inside device configuration");
+ } else {
Collection<ConnectionMap> connectionMap = deviceObject.get().nonnullConnectionMap().values();
Collection<ConnectionMap> connectionMap = deviceObject.get().nonnullConnectionMap().values();
- String slcp = null;
- String dlcp = null;
for (ConnectionMap cm : connectionMap) {
for (ConnectionMap cm : connectionMap) {
+ String slcp = null;
+ String dlcp = null;
String skey = cm.getSource().getCircuitPackName() + "+" + cm.getSource().getPortName();
if (lcpMap.containsKey(skey)) {
slcp = lcpMap.get(skey);
}
Destination destination0 = cm.nonnullDestination().values().iterator().next();
String dkey = destination0.getCircuitPackName() + "+" + destination0.getPortName();
String skey = cm.getSource().getCircuitPackName() + "+" + cm.getSource().getPortName();
if (lcpMap.containsKey(skey)) {
slcp = lcpMap.get(skey);
}
Destination destination0 = cm.nonnullDestination().values().iterator().next();
String dkey = destination0.getCircuitPackName() + "+" + destination0.getPortName();
+ if (slcp == null) {
+ LOG.error("Error in connection-map analysis for source {} and destination (circuitpack+port) {}",
+ skey, dkey);
+ continue;
+ }
if (lcpMap.containsKey(dkey)) {
dlcp = lcpMap.get(dkey);
}
if (lcpMap.containsKey(dkey)) {
dlcp = lcpMap.get(dkey);
}
- if (slcp != null) {
- Mapping mapping = mappingMap.get(slcp);
- mappingMap.remove(slcp);
- portMapList.add(createXpdrMappingObject(nodeId, null, null, null, null, mapping, dlcp, null));
- } else {
- LOG.error("Error in connection-map analysis");
- }
+ Mapping mapping = mappingMap.get(slcp);
+ mappingMap.remove(slcp);
+ portMapList.add(createXpdrMappingObject(nodeId, null, null, null, null, mapping, dlcp, null));
- } else {
- LOG.warn("No connection-map inside device configuration");
if (device.getOduSwitchingPools() != null) {
Collection<OduSwitchingPools> oduSwithcingPools = device.nonnullOduSwitchingPools().values();
List<SwitchingPoolLcp> switchingPoolList = new ArrayList<>();
if (device.getOduSwitchingPools() != null) {
Collection<OduSwitchingPools> oduSwithcingPools = device.nonnullOduSwitchingPools().values();
List<SwitchingPoolLcp> switchingPoolList = new ArrayList<>();
- if (device.getConnectionMap() != null) {
+ if (device.getConnectionMap() == null) {
+ LOG.warn("No connection-map inside device configuration");
+ } else {
Collection<ConnectionMap> connectionMap = deviceObject.get().nonnullConnectionMap().values();
Collection<ConnectionMap> connectionMap = deviceObject.get().nonnullConnectionMap().values();
- String slcp = null;
- String dlcp = null;
for (ConnectionMap cm : connectionMap) {
for (ConnectionMap cm : connectionMap) {
+ String slcp = null;
+ String dlcp = null;
String skey = cm.getSource().getCircuitPackName() + "+" + cm.getSource().getPortName();
if (lcpMap.containsKey(skey)) {
slcp = lcpMap.get(skey);
}
Destination destination0 = cm.nonnullDestination().values().iterator().next();
String dkey = destination0.getCircuitPackName() + "+" + destination0.getPortName();
String skey = cm.getSource().getCircuitPackName() + "+" + cm.getSource().getPortName();
if (lcpMap.containsKey(skey)) {
slcp = lcpMap.get(skey);
}
Destination destination0 = cm.nonnullDestination().values().iterator().next();
String dkey = destination0.getCircuitPackName() + "+" + destination0.getPortName();
+ if (slcp == null) {
+ LOG.error("Error in connection-map analysis for source {} and destination (circuitpack+port) {}",
+ skey, dkey);
+ continue;
+ }
if (lcpMap.containsKey(dkey)) {
dlcp = lcpMap.get(dkey);
}
if (lcpMap.containsKey(dkey)) {
dlcp = lcpMap.get(dkey);
}
- if (slcp != null) {
- Mapping mapping = mappingMap.get(slcp);
- mappingMap.remove(slcp);
- portMapList.add(createXpdrMappingObject(nodeId, null, null, null, null, mapping, dlcp, null));
- } else {
- LOG.error("Error in connection-map analysis");
- }
+ Mapping mapping = mappingMap.get(slcp);
+ mappingMap.remove(slcp);
+ portMapList.add(createXpdrMappingObject(nodeId, null, null, null, null, mapping, dlcp, null));
- } else {
- LOG.warn("No connection-map inside device configuration");
if (device.getOduSwitchingPools() != null) {
Collection<OduSwitchingPools> oduSwithcingPools = device.nonnullOduSwitchingPools().values();
List<SwitchingPoolLcp> switchingPoolList = new ArrayList<>();
if (device.getOduSwitchingPools() != null) {
Collection<OduSwitchingPools> oduSwithcingPools = device.nonnullOduSwitchingPools().values();
List<SwitchingPoolLcp> switchingPoolList = new ArrayList<>();