From 2fd6a2e5d048978e347835b3262643b224e5348b Mon Sep 17 00:00:00 2001 From: Guangrong Fu Date: Thu, 27 Oct 2022 10:52:55 +0800 Subject: bugfix - response message error Issue-ID: HOLMES-583 Signed-off-by: Guangrong Fu Change-Id: Ida28cec4c1ae5a8c0560b3d4db9ab1647216f021 --- .../main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java | 5 ++++- rulemgt/src/main/resources/logback-spring.xml | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java index ec6e9b3..0d5d110 100644 --- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/wrapper/RuleMgtWrapper.java @@ -16,6 +16,7 @@ package org.onap.holmes.rulemgt.wrapper; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.onap.holmes.common.api.entity.CorrelationRule; import org.onap.holmes.common.exception.CorrelationException; import org.onap.holmes.rulemgt.bean.request.*; @@ -79,7 +80,9 @@ public class RuleMgtWrapper { try { result = correlationRuleService.saveRule(correlationRule); } catch (CorrelationException e) { - engineWarpper.deleteRuleFromEngine(packageName, ip); + if (StringUtils.isNotEmpty(packageName)) { + engineWarpper.deleteRuleFromEngine(packageName, ip); + } throw new CorrelationException(e.getMessage(), e); } RuleAddAndUpdateResponse ruleAddAndUpdateResponse = new RuleAddAndUpdateResponse(); diff --git a/rulemgt/src/main/resources/logback-spring.xml b/rulemgt/src/main/resources/logback-spring.xml index eda9c6b..db95b38 100644 --- a/rulemgt/src/main/resources/logback-spring.xml +++ b/rulemgt/src/main/resources/logback-spring.xml @@ -9,7 +9,7 @@ UTF-8 - debug + info @@ -46,8 +46,8 @@ error - deny - accept + accept + deny -- cgit 1.2.3-korg