diff options
Diffstat (limited to 'controlloop/common/coordination')
3 files changed, 8 insertions, 4 deletions
diff --git a/controlloop/common/coordination/pom.xml b/controlloop/common/coordination/pom.xml index 622d01416..99adc6e14 100644 --- a/controlloop/common/coordination/pom.xml +++ b/controlloop/common/coordination/pom.xml @@ -4,6 +4,7 @@ ================================================================================ Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved. Modifications Copyright (C) 2020 Bell Canada. + Modifications Copyright (C) 2023 Nordix Foundation. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,7 +25,7 @@ <parent> <groupId>org.onap.policy.drools-applications.controlloop.common</groupId> <artifactId>drools-applications-common</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> </parent> <artifactId>coordination</artifactId> diff --git a/controlloop/common/coordination/src/main/java/org/onap/policy/coordination/Util.java b/controlloop/common/coordination/src/main/java/org/onap/policy/coordination/Util.java index af8cc2529..bfacc496e 100644 --- a/controlloop/common/coordination/src/main/java/org/onap/policy/coordination/Util.java +++ b/controlloop/common/coordination/src/main/java/org/onap/policy/coordination/Util.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,6 +33,7 @@ import java.util.stream.Stream; import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.Constructor; @@ -51,12 +53,12 @@ public final class Util { * @return the CoordinationDirective */ public static CoordinationDirective loadCoordinationDirectiveFromFile(String directiveFilename) { - try (var is = new FileInputStream(new File(directiveFilename))) { + try (var is = new FileInputStream(directiveFilename)) { var contents = IOUtils.toString(is, StandardCharsets.UTF_8); // // Read the yaml into our Java Object // - var yaml = new Yaml(new Constructor(CoordinationDirective.class)); + var yaml = new Yaml(new Constructor(CoordinationDirective.class, new LoaderOptions())); Object obj = yaml.load(contents); logger.debug(contents); diff --git a/controlloop/common/coordination/src/test/resources/test_coordination_directive.yaml b/controlloop/common/coordination/src/test/resources/test_coordination_directive.yaml index ede643c90..5f862e1df 100644 --- a/controlloop/common/coordination/src/test/resources/test_coordination_directive.yaml +++ b/controlloop/common/coordination/src/test/resources/test_coordination_directive.yaml @@ -1,4 +1,5 @@ # Copyright 2019 AT&T Intellectual Property. All rights reserved +# Modifications Copyright (C) 2023 Nordix Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -!!org.onap.policy.coordination.CoordinationDirective +#org.onap.policy.coordination.CoordinationDirective controlLoop: - cl1 |