Add trace for OpenstackRoutingFloatingIpHandler
Change-Id: I176c22889065082301e398b7bf4f858be57e6d28
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingFloatingIpHandler.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingFloatingIpHandler.java
index 1255838..0819e40 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingFloatingIpHandler.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingFloatingIpHandler.java
@@ -153,6 +153,7 @@
}
MacAddress srcMac = MacAddress.valueOf(osPort.getMacAddress());
+ log.trace("Mac address of openstack port: {}", srcMac);
InstancePort instPort = instancePortService.instancePort(srcMac);
if (instPort == null) {
final String errorFormat = ERR_FLOW + "no host(MAC:%s) found";
@@ -164,12 +165,17 @@
ExternalPeerRouter externalPeerRouter = externalPeerRouter(osNet);
if (externalPeerRouter == null) {
- return;
+ final String errorFormat = ERR_FLOW + "no external peer router found";
+ throw new IllegalStateException(errorFormat);
}
setComputeNodeToGateway(instPort, osNet, install);
setDownstreamRules(floatingIp, osNet, instPort, externalPeerRouter, install);
setUpstreamRules(floatingIp, osNet, instPort, externalPeerRouter, install);
+ log.trace("Succeeded to set flow rules for floating ip {}:{} and install: {}",
+ floatingIp.getFloatingIpAddress(),
+ floatingIp.getFixedIpAddress(),
+ install);
}
private void setComputeNodeToGateway(InstancePort instPort, Network osNet, boolean install) {
@@ -196,7 +202,8 @@
OpenstackNode selectedGatewayNode = selectGatewayNode();
if (selectedGatewayNode == null) {
- return;
+ final String errorFormat = ERR_FLOW + "no gateway node selected";
+ throw new IllegalStateException(errorFormat);
}
treatment = DefaultTrafficTreatment.builder()
.extension(buildExtension(
@@ -215,6 +222,7 @@
PRIORITY_EXTERNAL_FLOATING_ROUTING_RULE,
ROUTING_TABLE,
install);
+ log.trace("Succeeded to set flow rules from compute node to gateway on compute node");
}
private OpenstackNode selectGatewayNode() {
@@ -332,6 +340,7 @@
GW_COMMON_TABLE,
install);
});
+ log.trace("Succeeded to set flow rules for downstream on gateway nodes");
}
private void setUpstreamRules(NetFloatingIP floatingIp, Network osNet,
@@ -379,6 +388,7 @@
GW_COMMON_TABLE,
install);
});
+ log.trace("Succeeded to set flow rules for upstream on gateway nodes");
}
private ExternalPeerRouter externalPeerRouter(Network network) {