Catch exception generated during provisioning of subscriber
Before exceptions were silently dropped.
Also, rely on MacAddress.NONE definition for checking Mac Address validity.
Change-Id: Iec9d8a38df32708ddb0415a3b5116b7db685ea03
diff --git a/app/src/main/java/org/opencord/olt/impl/Olt.java b/app/src/main/java/org/opencord/olt/impl/Olt.java
index 000d5e6..0489f03 100644
--- a/app/src/main/java/org/opencord/olt/impl/Olt.java
+++ b/app/src/main/java/org/opencord/olt/impl/Olt.java
@@ -686,6 +686,10 @@
log.warn("Meter installation error while sending upstream flows. " +
"Result {} and MeterId {}", result, upstreamMeterId);
}
+ }).exceptionally(ex -> {
+ log.error("Upstream flow failed: " + ex.getMessage());
+ upFuture.complete(ObjectiveError.UNKNOWN);
+ return null;
});
downsteamMeterFuture.thenAcceptAsync(result -> {
@@ -719,6 +723,10 @@
log.warn("Meter installation error while sending upstream flows. " +
"Result {} and MeterId {}", result, downstreamMeterId);
}
+ }).exceptionally(ex -> {
+ log.error("Downstream flow failed: " + ex.getMessage());
+ downFuture.complete(ObjectiveError.UNKNOWN);
+ return null;
});
upFuture.thenAcceptBothAsync(downFuture, (upStatus, downStatus) -> {
diff --git a/app/src/main/java/org/opencord/olt/impl/OltFlowService.java b/app/src/main/java/org/opencord/olt/impl/OltFlowService.java
index af8ba4a..8e6ad0a 100644
--- a/app/src/main/java/org/opencord/olt/impl/OltFlowService.java
+++ b/app/src/main/java/org/opencord/olt/impl/OltFlowService.java
@@ -97,7 +97,6 @@
private static final String REMOVAL = "removal";
private static final String V4 = "V4";
private static final String V6 = "V6";
- private static final String NO_MAC = "A4:23:05:00:00:00";
private final Logger log = getLogger(getClass());
@@ -614,7 +613,8 @@
}
if (tagInformation.getConfiguredMacAddress() != null &&
- !NO_MAC.equals(tagInformation.getConfiguredMacAddress())) {
+ !tagInformation.getConfiguredMacAddress().equals("") &&
+ !MacAddress.NONE.equals(MacAddress.valueOf(tagInformation.getConfiguredMacAddress()))) {
selectorBuilder.matchEthDst(MacAddress.valueOf(tagInformation.getConfiguredMacAddress()));
}