summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Mokry <mm117s@att.com>2018-01-11 15:23:36 -0600
committerMichael Mokry <mm117s@att.com>2018-01-16 13:45:16 +0000
commit49c6b1bf604c3450b729dc348af36ee3af79589b (patch)
treecdc0b17c6f0c2fb58741f410ef9762478bc16ecf
parentc7ebb39ee23233b0104d3a0f9b1f8fdd66911d18 (diff)
PDPGroup Audit Fix
*This fix will add new group to GroupEntity table if no default exists during initialization and therefore provides a permanent solution to the initialization errors on the PAP Change-Id: Ie394d76b9cbc02cad15d62d6adea6fc17938f734 Issue-ID: POLICY-486 Signed-off-by: Michael Mokry <mm117s@att.com> (cherry picked from commit 676d7d8dc9985e93d7c9cbc0412a26f2b19c23cd)
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDao.java3
-rw-r--r--ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdEngine.java1
2 files changed, 3 insertions, 1 deletions
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDao.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDao.java
index 70745b9b3..b2fb3e5a8 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDao.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/PolicyDBDao.java
@@ -2839,7 +2839,8 @@ public class PolicyDBDao {
try{
while(policyIt.hasNext()){
PolicyEntity pol = policyIt.next();
- if(getPolicyNameAndVersionFromPolicyFileName(pol.getPolicyName())[0].equals(policyName)){
+ if(policy.getScope().equals(pol.getScope()) &&
+ getPolicyNameAndVersionFromPolicyFileName(pol.getPolicyName())[0].equals(policyName)) {
policyIt.remove();
}
}
diff --git a/ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdEngine.java b/ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdEngine.java
index 09c5a6aba..f046a3c45 100644
--- a/ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdEngine.java
+++ b/ONAP-XACML/src/main/java/org/onap/policy/xacml/std/pap/StdEngine.java
@@ -171,6 +171,7 @@ public class StdEngine extends StdPDPItemSetChangeNotifier implements PAPPolicyE
//
PDPGroup group = this.getDefaultGroup();
if (group != null) {
+ wasDefaultGroupJustAdded = true;
return group;
}
//