[SDFAB-19] Submitting a policy multiple times leads the policy in PENDING_ADD

Change-Id: I225bb1f3a7ea7e86f6723c00c8597653b6ede543
diff --git a/impl/src/main/java/org/onosproject/segmentrouting/policy/impl/PolicyManager.java b/impl/src/main/java/org/onosproject/segmentrouting/policy/impl/PolicyManager.java
index 1d4d471..089612b 100644
--- a/impl/src/main/java/org/onosproject/segmentrouting/policy/impl/PolicyManager.java
+++ b/impl/src/main/java/org/onosproject/segmentrouting/policy/impl/PolicyManager.java
@@ -426,7 +426,10 @@
             // DROP policies do not need the next objective installation phase
             // we can update directly the map and signal the ops as done
             operation.isDone(true);
-            operations.put(policyKey.toString(), operation.build());
+            Operation preOp = Versioned.valueOrNull(operations.put(policyKey.toString(), operation.build()));
+            if (preOp != null && preOp.equals(operation.build())) {
+                updatePolicy(policy.policyId(), true);
+            }
         } else if (policy.policyType() == PolicyType.REDIRECT) {
             // REDIRECT Uses next objective context to update the ops as done when
             // it returns successfully. In the other cases leaves the ops as undone