From 51348c0dac96d4499035ac771d660f52e0c4006a Mon Sep 17 00:00:00 2001 From: "Hansen, Tony (th1395)" Date: Tue, 20 Jul 2021 22:05:23 +0000 Subject: onap-dcae-cbs-docker-client remove "config" level for get_config() Change-Id: Ic8949abc0f9316999f7c3b67fdeb86d5ff172b72 Signed-off-by: Hansen, Tony (th1395) Issue-ID: DCAEGEN2-2733 Issue-ID: DCAEGEN2-2753 --- onap-dcae-cbs-docker-client/Changelog.md | 3 +++ onap-dcae-cbs-docker-client/onap_dcae_cbs_docker_client/client.py | 2 +- onap-dcae-cbs-docker-client/pom.xml | 2 +- onap-dcae-cbs-docker-client/setup.py | 6 +++--- onap-dcae-cbs-docker-client/tests/test_client.py | 6 +++--- 5 files changed, 11 insertions(+), 8 deletions(-) (limited to 'onap-dcae-cbs-docker-client') diff --git a/onap-dcae-cbs-docker-client/Changelog.md b/onap-dcae-cbs-docker-client/Changelog.md index c70aff4..dd284fe 100644 --- a/onap-dcae-cbs-docker-client/Changelog.md +++ b/onap-dcae-cbs-docker-client/Changelog.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [2.2.1] 2021/07/20 +* DCAEGEN2-2733/DCAEGEN2-2753 - onap-dcae-cbs-docker-client remove "config" level for get_config() + ## [2.2.0] 2021/06/22 * DCAEGEN2-2733/DCAEGEN2-2753 - onap-dcae-cbs-docker-client support local config and policy files Support $CBS_CLIENT_CONFIG_PATH and $CBS_CLIENT_POLICY_PATH, diff --git a/onap-dcae-cbs-docker-client/onap_dcae_cbs_docker_client/client.py b/onap-dcae-cbs-docker-client/onap_dcae_cbs_docker_client/client.py index c42b4ae..a9bfa34 100644 --- a/onap-dcae-cbs-docker-client/onap_dcae_cbs_docker_client/client.py +++ b/onap-dcae-cbs-docker-client/onap_dcae_cbs_docker_client/client.py @@ -219,7 +219,7 @@ def get_config(): config = yaml.safe_load(fp) logger.debug(f"Returning config read from {config_path}") - return _recurse({"config": config}) + return _recurse(config) except yaml.scanner.ScannerError as e: logger.error(f"The configuration file '{config_path}' has invalid YAML: {e}") diff --git a/onap-dcae-cbs-docker-client/pom.xml b/onap-dcae-cbs-docker-client/pom.xml index 4783ada..b70bf48 100644 --- a/onap-dcae-cbs-docker-client/pom.xml +++ b/onap-dcae-cbs-docker-client/pom.xml @@ -28,7 +28,7 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property. org.onap.dcaegen2.utils onap-dcae-cbs-docker-client dcaegen2-utils-python-cbs-docker-client - 2.2.0-SNAPSHOT + 2.2.1-SNAPSHOT http://maven.apache.org diff --git a/onap-dcae-cbs-docker-client/setup.py b/onap-dcae-cbs-docker-client/setup.py index 585d628..2656a1f 100644 --- a/onap-dcae-cbs-docker-client/setup.py +++ b/onap-dcae-cbs-docker-client/setup.py @@ -20,10 +20,10 @@ from setuptools import setup, find_packages setup( name="onap_dcae_cbs_docker_client", description="very lightweight client for a DCAE dockerized component to get it's config from the CBS", - version="2.2.0", + version="2.2.1", packages=find_packages(), - author="Tommy Carpenter", - author_email="tommy@research.att.com", + author="Tony Hansen", + author_email="tony@att.com", license="Apache 2", url="https://gerrit.onap.org/r/#/admin/projects/dcaegen2/utils", install_requires=["requests>= 2.0.0, < 3.0.0"], diff --git a/onap-dcae-cbs-docker-client/tests/test_client.py b/onap-dcae-cbs-docker-client/tests/test_client.py index 76249d4..48e1f78 100644 --- a/onap-dcae-cbs-docker-client/tests/test_client.py +++ b/onap-dcae-cbs-docker-client/tests/test_client.py @@ -247,7 +247,7 @@ def test_config_file_both_exist(monkeypatch, monkeyed_requests_get): else: monkeypatch.delenv("CBS_CLIENT_CONFIG_PATH") - expected_get_config = {"config": expected_config} + expected_get_config = expected_config for (policy_path, expected_policy, set_policy) in [ ("policy/path", json.loads(found_policy_path)['policies'], True), @@ -292,7 +292,7 @@ def test_config_file_config_exists_policy_does_not(monkeypatch, monkeyed_request else: monkeypatch.delenv("CBS_CLIENT_CONFIG_PATH") - expected_get_config = {"config": expected_config} + expected_get_config = expected_config expected_get_all = {"config": expected_config} for (policy_path, expected_policy, set_policy) in [ @@ -381,7 +381,7 @@ def test_config_file_various_exceptions(monkeypatch, monkeyed_requests_get): else: monkeypatch.delenv("CBS_CLIENT_CONFIG_PATH") - expected_get_config = {"config": expected_config} + expected_get_config = expected_config expected_get_all = {"config": expected_config} for policy_path in ["bad/policy", "bad/policy2", -- cgit 1.2.3-korg