[ONOS-5038] Bug fix for "pending_add" flow rules

Corrects deviceIds when build Nicira extension flow rules.

Change-Id: I8dc196d36e5518fe172769b2b957c929a7136d52
diff --git a/apps/openstacknetworking/routing/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackPnatHandler.java b/apps/openstacknetworking/routing/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackPnatHandler.java
index b6c998a..9431e4f 100644
--- a/apps/openstacknetworking/routing/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackPnatHandler.java
+++ b/apps/openstacknetworking/routing/src/main/java/org/onosproject/openstacknetworking/routing/OpenstackPnatHandler.java
@@ -316,7 +316,7 @@
 
         tBuilder.setIpSrc(externalIp);
         gatewayService.getGatewayNodes().stream().forEach(gateway -> {
-            TrafficTreatment.Builder tmpBuilder = tBuilder;
+            TrafficTreatment.Builder tmpBuilder = DefaultTrafficTreatment.builder(tBuilder.build());
             tmpBuilder.setOutput(gatewayService.getUplinkPort(gateway.getGatewayDeviceId()));
             ForwardingObjective fo = DefaultForwardingObjective.builder()
                     .withSelector(sBuilder.build())
@@ -376,7 +376,7 @@
 
         gatewayService.getGatewayDeviceIds().stream().forEach(deviceId -> {
             DeviceId srcDeviceId = srcVm.get().location().deviceId();
-            TrafficTreatment.Builder tmpBuilder = tBuilder;
+            TrafficTreatment.Builder tmpBuilder = DefaultTrafficTreatment.builder(tBuilder.build());
             tmpBuilder.extension(RulePopulatorUtil.buildExtension(
                     deviceService,
                     deviceId,