diff options
author | Michael Mokry <mm117s@att.com> | 2018-04-12 09:45:06 -0500 |
---|---|---|
committer | Michael Mokry <mm117s@att.com> | 2018-04-12 09:49:46 -0500 |
commit | 882850a0f5a147c45749facf2e78bccafce1760d (patch) | |
tree | 1da022820132f8d6ccddf9a319d5ff50defd117d /ONAP-PAP-REST/src/main/java | |
parent | 1c6d62ab27dcb3491cf52f939b06232a5c64c1ba (diff) |
OOF Policy Config File Creation Issue
Fixed the issue with creating the config file with the wrong file name
so that the PDP can pick it up when pushing the policy and getCOnfig
will return the Config retrieved rather than a CONFIG_NOT_FOUND 400
status.
I found this issue in the new CSIT tests for HPA policies and this
should also resolve the failed test in Integration as well.
Change-Id: I617133a188f3ba915feafd79da4f3e9d0b0eb4a6
Issue-ID: POLICY-738
Signed-off-by: Michael Mokry <mm117s@att.com>
Diffstat (limited to 'ONAP-PAP-REST/src/main/java')
-rw-r--r-- | ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/OptimizationConfigPolicy.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/OptimizationConfigPolicy.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/OptimizationConfigPolicy.java index 2a03482d2..18d588c8f 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/OptimizationConfigPolicy.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/OptimizationConfigPolicy.java @@ -88,10 +88,12 @@ public class OptimizationConfigPolicy extends Policy { //save configuration of the policy based on the policyname private void saveConfigurations(String policyName, String jsonBody) { + + if(policyName.endsWith(".xml")){ + policyName = policyName.replace(".xml", ""); + } + try (PrintWriter out = new PrintWriter(CONFIG_HOME + File.separator + policyName +".json");){ - if(policyName.endsWith(".xml")){ - policyName = policyName.replace(".xml", ""); - } out.println(jsonBody); } catch (Exception e) { LOGGER.error("Exception Occured While writing Configuration data"+e); |