From: Pamela Dragosh Date: Thu, 24 May 2018 11:04:37 +0000 (+0000) Subject: Merge "Replace LOGPATH with LOGSUFFIX" X-Git-Tag: v1.2.3~2 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=commitdiff_plain;h=2f8ab5851fb070fac82472cf8a3c8542a657ca01;hp=ee033842018375e0200a9b8f2e0dc813974440fd Merge "Replace LOGPATH with LOGSUFFIX" --- diff --git a/BRMSGateway/config.properties b/BRMSGateway/config.properties index 081d308ca..e716c49fc 100644 --- a/BRMSGateway/config.properties +++ b/BRMSGateway/config.properties @@ -77,6 +77,6 @@ ping_interval=30000 # # # -brms.dependency.version=1.2.2 +brms.dependency.version=1.2.3 ENVIRONMENT = DEVL diff --git a/BRMSGateway/dependency.json b/BRMSGateway/dependency.json index aa200f1ae..000d3f61a 100644 --- a/BRMSGateway/dependency.json +++ b/BRMSGateway/dependency.json @@ -3,96 +3,96 @@ "default": [{ "groupId": "org.onap.policy.drools-applications.controlloop.templates", "artifactId": "template.demo", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common.model-impl", "artifactId": "events", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common.model-impl", "artifactId": "rest", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common.model-impl", "artifactId": "appc", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common.model-impl", "artifactId": "aai", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common.model-impl", "artifactId": "so", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common.model-impl", "artifactId": "trafficgenerator", - "version": "1.2.2" + "version": "1.2.3" }], "amsterdam": [{ "groupId": "org.onap.policy.drools-applications.controlloop.common.model-impl", "artifactId": "events", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common.model-impl", "artifactId": "appc", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common.model-impl", "artifactId": "appclcm", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common.model-impl", "artifactId": "vfc", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common.model-impl", "artifactId": "so", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common.model-impl", "artifactId": "aai", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common.model-impl", "artifactId": "sdc", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common.model-impl", "artifactId": "trafficgenerator", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common", "artifactId": "eventmanager", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common", "artifactId": "guard", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common.actors", "artifactId": "actorServiceProvider", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common.actors", "artifactId": "actor.appc", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common.actors", "artifactId": "actor.appclcm", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common.actors", "artifactId": "actor.so", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common.actors", "artifactId": "actor.vfc", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "org.onap.policy.drools-applications.controlloop.common", "artifactId": "policy-yaml", - "version": "1.2.2" + "version": "1.2.3" }, { "groupId": "com.att.research.xacml", "artifactId": "xacml-pdp", diff --git a/BRMSGateway/pom.xml b/BRMSGateway/pom.xml index eabf00f34..e6e9bafae 100644 --- a/BRMSGateway/pom.xml +++ b/BRMSGateway/pom.xml @@ -24,7 +24,7 @@ org.onap.policy.engine PolicyEngineSuite - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT BRMSGateway This application will take in BRMS rules and acts as interface between PR and PDP XACML diff --git a/BRMSGateway/src/main/java/org/onap/policy/brms/api/BrmsPush.java b/BRMSGateway/src/main/java/org/onap/policy/brms/api/BrmsPush.java index a15eee34d..caf49aa55 100644 --- a/BRMSGateway/src/main/java/org/onap/policy/brms/api/BrmsPush.java +++ b/BRMSGateway/src/main/java/org/onap/policy/brms/api/BrmsPush.java @@ -118,7 +118,7 @@ public class BrmsPush { private static final Logger LOGGER = FlexLogger.getLogger(BrmsPush.class.getName()); private static final String PROJECTSLOCATION = "RuleProjects"; private static final String[] GOALS = {"clean", "deploy"}; - private static final String DEFAULT_VERSION = "1.2.2"; + private static final String DEFAULT_VERSION = "1.2.3"; private static final String DEPENDENCY_FILE = "dependency.json"; private static final String BRMSPERSISTENCE = "brmsEclipselink.persistencexml"; diff --git a/BRMSGateway/src/test/resources/config.properties b/BRMSGateway/src/test/resources/config.properties index 2330424b4..25eeb83a6 100644 --- a/BRMSGateway/src/test/resources/config.properties +++ b/BRMSGateway/src/test/resources/config.properties @@ -81,6 +81,6 @@ ping_interval=30000 # # # -brms.dependency.version=1.2.2 +brms.dependency.version=1.2.3 ENVIRONMENT = DEVL diff --git a/LogParser/pom.xml b/LogParser/pom.xml index e887bf03e..1dd7ee8d3 100644 --- a/LogParser/pom.xml +++ b/LogParser/pom.xml @@ -25,7 +25,7 @@ org.onap.policy.engine PolicyEngineSuite - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT LogParser diff --git a/ONAP-PAP-REST/pom.xml b/ONAP-PAP-REST/pom.xml index 2c694d293..15b512599 100644 --- a/ONAP-PAP-REST/pom.xml +++ b/ONAP-PAP-REST/pom.xml @@ -28,7 +28,7 @@ org.onap.policy.engine PolicyEngineSuite - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT diff --git a/ONAP-PDP-REST/pom.xml b/ONAP-PDP-REST/pom.xml index 6ab3b4970..656da4b24 100644 --- a/ONAP-PDP-REST/pom.xml +++ b/ONAP-PDP-REST/pom.xml @@ -24,7 +24,7 @@ org.onap.policy.engine PolicyEngineSuite - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT ONAP-PDP-REST ONAP PDP REST diff --git a/ONAP-PDP/pom.xml b/ONAP-PDP/pom.xml index 33af65235..c329fba0c 100644 --- a/ONAP-PDP/pom.xml +++ b/ONAP-PDP/pom.xml @@ -28,7 +28,7 @@ org.onap.policy.engine PolicyEngineSuite - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT diff --git a/ONAP-REST/pom.xml b/ONAP-REST/pom.xml index 2776c89b5..dbde32284 100644 --- a/ONAP-REST/pom.xml +++ b/ONAP-REST/pom.xml @@ -26,7 +26,7 @@ org.onap.policy.engine PolicyEngineSuite - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT ONAP-REST ONAP REST diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/util/MSModelUtils.java b/ONAP-REST/src/main/java/org/onap/policy/rest/util/MSModelUtils.java index 7db16bda5..1a62ccc88 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/util/MSModelUtils.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/util/MSModelUtils.java @@ -763,13 +763,16 @@ public class MSModelUtils { } catch (IOException e) { logger.error(e); + }catch(ParserException e){ + logger.error(e); + return e.getMessage(); } return null; } @SuppressWarnings("unchecked") - public LinkedHashMap load(String fileName) throws IOException { + public LinkedHashMap load(String fileName) throws IOException,ParserException { File newConfiguration = new File(fileName); StringBuilder orderInfo = new StringBuilder("["); Yaml yaml = new Yaml(); @@ -778,6 +781,8 @@ public class MSModelUtils { yamlMap = (LinkedHashMap) yaml.load(is); } catch (FileNotFoundException e) { logger.error(e); + }catch(Exception e){ + throw new ParserException("Invalid TOSCA Model format. Please make sure it is a valid YAML file"); } StringBuilder sb = new StringBuilder(); @@ -1098,17 +1103,25 @@ public class MSModelUtils { stringListItems.append(uniqueDataKeySplit[1].toUpperCase()+":required-"+requiredValue +":MANY-true"); } dataMapForJson.put(uniqueDataKey, stringListItems.toString()); - dataListBuffer.append(uniqueDataKeySplit[1].toUpperCase()+"=["); + boolean isConstraintsFound = false; for(int i=0;i<10;i++){ String findConstraints= DATATYPE+uniqueDataKeySplit[0]+PROPERTIES+uniqueDataKeySplit[1]+".entry_schema.constraints.0.valid_values."+i; logger.info("findConstraints => " + findConstraints); String constraintsValue=map.get(findConstraints); logger.info("constraintsValue => " + constraintsValue); - if(constraintsValue==null){ + if((constraintsValue==null || constraintsValue.isEmpty()) && i==0){ //if no constraints at all ( index i as 0 can tell this ) + isConstraintsFound = false; + //if type is list but no constraints + String newValue = dataMapForJson.get(uniqueDataKey).replace("MANY-false", "MANY-true"); + newValue = newValue.replace(uniqueDataKeySplit[1].toUpperCase()+":", ""); + dataMapForJson.put(uniqueDataKey, newValue); break; - } - else{ - logger.info("constraintsValue => " + constraintsValue); + } else{ + isConstraintsFound = true; + if(i == 0){ // only need to add one time for the same attribute + dataListBuffer.append(uniqueDataKeySplit[1].toUpperCase()+"=["); + } + if(constraintsValue.contains("=")){ constraintsValue = constraintsValue.replace("=", "equal-sign"); } @@ -1116,9 +1129,12 @@ public class MSModelUtils { dataListBuffer.append(constraintsValue+","); } } - dataListBuffer.append("]#"); - logger.info(dataListBuffer); + if(isConstraintsFound){ + dataListBuffer.append("]#"); + } } + }else{ + logger.info("entry_schema.type is not defined correctly"); } } else{ @@ -1138,7 +1154,7 @@ public class MSModelUtils { } - LinkedHashMap> parsePolicyNodes(Map map){ + LinkedHashMap> parsePolicyNodes(Map map) throws ParserException{ LinkedHashMap> mapKey= new LinkedHashMap <>(); for(String uniqueKey: uniqueKeys){ LinkedHashMap hm; @@ -1150,7 +1166,11 @@ public class MSModelUtils { hm = mapKey.get(uniqueKey); String keyStr= key.substring(key.lastIndexOf('.')+1); String valueStr= map.get(key); - if(("type").equals(keyStr)){ + if("type".equalsIgnoreCase(keyStr) && ((key.contains("entry_schema.0.type") || key.contains("entry_schema.type") && valueStr.contains("policy.data.")))){ + throw new ParserException("For using user defined object type, Please make sure no space between 'type:' and object " + valueStr ); + + } + if("type".equals(keyStr)){ if(!key.contains("entry_schema")) { hm.put(keyStr,valueStr); @@ -1163,6 +1183,9 @@ public class MSModelUtils { hm = new LinkedHashMap <>(); String keyStr= key.substring(key.lastIndexOf('.')+1); String valueStr= map.get(key); + if(key.contains(".objective.")){ + throw new ParserException("Attribute objective is a key word. Please use a different name"); + } if(("type").equals(keyStr)){ if(!key.contains("entry_schema")) { diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/util/ParserException.java b/ONAP-REST/src/main/java/org/onap/policy/rest/util/ParserException.java new file mode 100644 index 000000000..be7acb4f2 --- /dev/null +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/util/ParserException.java @@ -0,0 +1,30 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP-REST + * ================================================================================ + * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.policy.rest.util; + +public class ParserException extends Exception{ + String message; + ParserException(String message) { + this.message = message; + } + public String getMessage(){ + return message ; + } +} \ No newline at end of file diff --git a/ONAP-REST/src/test/java/org/onap/policy/rest/util/MSModelUtilsTest.java b/ONAP-REST/src/test/java/org/onap/policy/rest/util/MSModelUtilsTest.java index aa41429b9..6a9c4c4ec 100644 --- a/ONAP-REST/src/test/java/org/onap/policy/rest/util/MSModelUtilsTest.java +++ b/ONAP-REST/src/test/java/org/onap/policy/rest/util/MSModelUtilsTest.java @@ -95,6 +95,8 @@ public class MSModelUtilsTest { } catch (IOException e) { logger.error("testLoad", e); result = null; + }catch(ParserException e){ + logger.error("testLoad", e); } assertTrue(result != null && !result.isEmpty()); diff --git a/ONAP-SDK-APP/pom.xml b/ONAP-SDK-APP/pom.xml index ddc425273..16fc240ad 100644 --- a/ONAP-SDK-APP/pom.xml +++ b/ONAP-SDK-APP/pom.xml @@ -23,7 +23,7 @@ org.onap.policy.engine PolicyEngineSuite - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT ONAP-SDK-APP war diff --git a/ONAP-XACML/pom.xml b/ONAP-XACML/pom.xml index b2aa41611..f7b9bba62 100644 --- a/ONAP-XACML/pom.xml +++ b/ONAP-XACML/pom.xml @@ -25,7 +25,7 @@ org.onap.policy.engine PolicyEngineSuite - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT ONAP-XACML jar diff --git a/POLICY-SDK-APP/pom.xml b/POLICY-SDK-APP/pom.xml index f5ced6814..0ce7b9d92 100644 --- a/POLICY-SDK-APP/pom.xml +++ b/POLICY-SDK-APP/pom.xml @@ -23,7 +23,7 @@ org.onap.policy.engine PolicyEngineSuite - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT POLICY-SDK-APP war diff --git a/PolicyEngineAPI/pom.xml b/PolicyEngineAPI/pom.xml index 09e647a04..9fd60d14d 100644 --- a/PolicyEngineAPI/pom.xml +++ b/PolicyEngineAPI/pom.xml @@ -25,7 +25,7 @@ org.onap.policy.engine PolicyEngineSuite - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT PolicyEngineAPI diff --git a/PolicyEngineClient/pom.xml b/PolicyEngineClient/pom.xml index 0c0d7fc54..78fa7a55d 100644 --- a/PolicyEngineClient/pom.xml +++ b/PolicyEngineClient/pom.xml @@ -25,7 +25,7 @@ org.onap.policy.engine PolicyEngineSuite - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT PolicyEngineClient diff --git a/PolicyEngineUtils/pom.xml b/PolicyEngineUtils/pom.xml index cefb9b8bf..2baed14fe 100644 --- a/PolicyEngineUtils/pom.xml +++ b/PolicyEngineUtils/pom.xml @@ -23,7 +23,7 @@ org.onap.policy.engine PolicyEngineSuite - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT PolicyEngineUtils diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 5164ddcc4..7ae0c9065 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -13,10 +13,10 @@ Policy Release Notes .. * This note must be removed after content has been added. -Version: 1.2.2 +Version: 1.2.3 -------------- -:Release Date: 2018-05-24 (Beijing Release) +:Release Date: 2018-06-07 (Beijing Release) **New Features** @@ -82,7 +82,6 @@ The Beijing release for POLICY delivered the following Epics. For a full list of **Bug Fixes** - * `[POLICY-454] `_ - brmsgw 1.1.2 policy rules generation in a 1.1.1 docker image * `[POLICY-484] `_ - Extend election handler run window and clean up error messages * `[POLICY-494] `_ - POLICY EELF Audit.log not in ECOMP Standards Compliance * `[POLICY-501] `_ - Fix issues blocking election handler and add directed interface for opstate @@ -98,12 +97,11 @@ The Beijing release for POLICY delivered the following Epics. For a full list of * `[POLICY-743] `_ - Fixed data name since its name was changed on server side * `[POLICY-753] `_ - Policy Health Check failed with multi-node cluster * `[POLICY-765] `_ - junit test for guard fails intermittently - * `[POLICY-796] `_ - VirtualControlLoopEvent facts are piling up **Security Issues** - * Please see the `Policy R2 Beijing Security/Vulnerability Threat `_ page for security related issues. + * Refer to the `Policy R2 Beijing Security/Vulnerability Threat `_ page for security related issues. **Known Issues** @@ -112,6 +110,7 @@ The Beijing release for POLICY delivered the following Epics. For a full list of * `[POLICY-764] `_ - Policy Engine PIP Configuration JUnit Test fails intermittently * `[POLICY-776] `_ - OOF Policy TOSCA models are not correctly rendered * `[POLICY-799] `_ - Policy API Validation Does Not Validate Required Parent Attributes in the Model + * `[POLICY-801] `_ - fields mismatch for OOF flavorFeatures between implementation and wiki @@ -219,7 +218,9 @@ The Amsterdam release continued evolving the design driven architecture of and f .. For initial document: list epic and user stories for each, list user stories with no epics. .. For Bugs section, list bugs that are not tied to an epic. Remove all items with "Won't Do" resolution. .. 01/15/2018 - Added change for version 1.1.3 to the Amsterdam branch. Also corrected prior version (1.2.0) to (1.1.1) -.. 11/16/2017 - Initial document for Amsterdam release. +.. Also, Set up initial information for Beijing. +.. 05/21/2018 - Information for Beijing release. +.. Excluded POLICY-454 from bug list since it doesn't apply to Beijing per Jorge. End of Release Notes diff --git a/packages/base/pom.xml b/packages/base/pom.xml index 9ee6e4e0a..2a60f14eb 100755 --- a/packages/base/pom.xml +++ b/packages/base/pom.xml @@ -26,7 +26,7 @@ org.onap.policy.engine packages - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT base diff --git a/packages/base/src/files/install/servers/brmsgw/config.properties b/packages/base/src/files/install/servers/brmsgw/config.properties index fa7909608..c6c122e2f 100644 --- a/packages/base/src/files/install/servers/brmsgw/config.properties +++ b/packages/base/src/files/install/servers/brmsgw/config.properties @@ -84,6 +84,6 @@ test_via_jmx=${{test_via_jmx}} ping_interval=30000 -brms.dependency.version=1.2.2 +brms.dependency.version=1.2.3 CLIENT_FILE=client.properties diff --git a/packages/docker/pom.xml b/packages/docker/pom.xml index 2ebd49699..d001c5415 100644 --- a/packages/docker/pom.xml +++ b/packages/docker/pom.xml @@ -26,7 +26,7 @@ org.onap.policy.engine packages - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT docker diff --git a/packages/install/pom.xml b/packages/install/pom.xml index 79274bc63..14d3a7863 100644 --- a/packages/install/pom.xml +++ b/packages/install/pom.xml @@ -26,7 +26,7 @@ org.onap.policy.engine packages - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT install diff --git a/packages/pom.xml b/packages/pom.xml index 3de0648be..6a869d02e 100644 --- a/packages/pom.xml +++ b/packages/pom.xml @@ -24,7 +24,7 @@ org.onap.policy.engine PolicyEngineSuite - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT packages pom diff --git a/pom.xml b/pom.xml index 0fde2900d..4fbaf627f 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ org.onap.policy.engine PolicyEngineSuite - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT pom policy-engine The ONAP Policy Engine main pom diff --git a/version.properties b/version.properties index 7e20a36bf..b80ccebde 100644 --- a/version.properties +++ b/version.properties @@ -24,7 +24,7 @@ major=1 minor=2 -patch=2 +patch=3 base_version=${major}.${minor}.${patch}