summaryrefslogtreecommitdiffstats
path: root/controlloop/common
diff options
context:
space:
mode:
authorTemoc Rodriguez <cr056n@att.com>2017-10-06 07:57:02 -0700
committerTemoc Rodriguez <cr056n@att.com>2017-10-06 07:57:02 -0700
commit5a8dcfc830a71d28029254a14aa9a085b9a8af5a (patch)
tree36287ac1223171f2098d00e0931a2ae8ff346447 /controlloop/common
parentdb6d2468fc672a23ed152b8624b34de01ff13233 (diff)
Add fix for guard db on disable
Added a fix so that the guard database is not attempted to be accessed while guard is set to disabled. The guard db access is done in the operations manager which has no context of guardat the moment. Because of this separation, the boolean must be grabbed from the PolicyEngine properties. We should consider some guard refactoring. Issue-ID: POLICY-296 Change-Id: Ida7a2a7c19e568b076731e0f04bdc8a9fd0fcb26 Signed-off-by: Temoc Rodriguez <cr056n@att.com>
Diffstat (limited to 'controlloop/common')
-rw-r--r--controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java
index 6e57b5ef0..89b702d63 100644
--- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java
+++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java
@@ -44,6 +44,7 @@ import org.onap.policy.controlloop.actor.vfc.VFCActorServiceProvider;
import org.onap.policy.controlloop.policy.Policy;
import org.onap.policy.controlloop.policy.PolicyResult;
import org.onap.policy.controlloop.actor.so.SOActorServiceProvider;
+import org.onap.policy.drools.system.PolicyEngine;
import org.onap.policy.so.SOResponse;
import org.onap.policy.vfc.VFCResponse;
import org.slf4j.Logger;
@@ -541,6 +542,12 @@ public class ControlLoopOperationManager implements Serializable {
}
private void storeOperationInDataBase(){
+ // Only store in DB if enabled
+ boolean guardEnabled = "false".equalsIgnoreCase(PolicyEngine.manager.getEnvironmentProperty("guard.disabled"));
+ if( !guardEnabled ){
+ return;
+ }
+
// DB Properties
Properties props = new Properties();