From c2c6ff8aa475ebeaf55681c3836ba41a62782d09 Mon Sep 17 00:00:00 2001 From: vv770d Date: Wed, 21 Jul 2021 18:03:16 +0000 Subject: Switch to 2.2.1 CBS client lib Change-Id: Id4569bf141dc7c48e15eed5d624042e498dde4ea Signed-off-by: vv770d Issue-ID: DCAEGEN2-2852 Signed-off-by: vv770d --- Changelog.md | 1 + miss_htbt_service/misshtbtd.py | 6 +++--- miss_htbt_service/mod/trapd_get_cbs_config.py | 5 +++-- requirements-common.txt | 2 +- setup.py | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Changelog.md b/Changelog.md index 811e669..b40916e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Removed extraneous parentheses - Use yyyy/mm/dd format in Changelog - Removed volume mapping from Dockerfile +- Switched to CBS client 2.2.1 ### Fixed - pytest fails if http\_proxy is set diff --git a/miss_htbt_service/misshtbtd.py b/miss_htbt_service/misshtbtd.py index 89ae05f..0ebffe7 100644 --- a/miss_htbt_service/misshtbtd.py +++ b/miss_htbt_service/misshtbtd.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # ============LICENSE_START======================================================= -# Copyright (c) 2017-2020 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2021 AT&T Intellectual Property. All rights reserved. # Copyright (c) 2019 Pantheon.tech. All rights reserved. # Copyright 2020 Deutsche Telekom. All rights reserved. # Copyright 2021 Samsung Electronics. All rights reserved. @@ -239,7 +239,7 @@ def read_hb_properties(jsfile): with open(jsfile, 'r') as outfile: cfg = json.load(outfile) except Exception as err: - msg = "CBS Json file load error - ", err + msg = "CBS Json file load error - " + str(err) _logger.error(msg) return read_hb_properties_default() @@ -259,7 +259,7 @@ def read_hb_properties(jsfile): if "SERVICE_NAME" in cfg: os.environ['SERVICE_NAME'] = str(cfg['SERVICE_NAME']) except Exception as err: - msg = "CBS Json file read parameter error - ", err + msg = "CBS Json file read parameter error - " + str(err) _logger.error(msg) return read_hb_properties_default() return ip_address, port_num, user_name, password, db_name, cbs_polling_required, cbs_polling_interval diff --git a/miss_htbt_service/mod/trapd_get_cbs_config.py b/miss_htbt_service/mod/trapd_get_cbs_config.py index 431f93b..70dac53 100644 --- a/miss_htbt_service/mod/trapd_get_cbs_config.py +++ b/miss_htbt_service/mod/trapd_get_cbs_config.py @@ -1,7 +1,7 @@ # ============LICENSE_START======================================================= # org.onap.dcae # ================================================================================ -# Copyright (c) 2018-2020 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2018-2021 AT&T Intellectual Property. All rights reserved. # Copyright (c) 2019 Pantheon.tech. All rights reserved. # Copyright 2020 Deutsche Telekom. All rights reserved. # Copyright 2021 Samsung Electronics. All rights reserved. @@ -61,12 +61,13 @@ def get_cbs_config(): try: msg = "Unable to fetch CBS config or it is erroneously empty - trying override/simulator config" tds.c_config = get_config() + stdout_logger("CBS client lib response : " + str(tds.c_config)) if tds.c_config == {}: stdout_logger(msg) # if no CBS present, default to JSON config specified via CBS_HTBT_JSON env var except Exception as e: - msg = "ONAP controller not present, trying json config override via CBS_HTBT_JSON env variable" + msg = "ONAP controller not present, trying json config override via CBS_HTBT_JSON env variableo, " + str(e) stdout_logger(msg) try: diff --git a/requirements-common.txt b/requirements-common.txt index e8a2fe7..0ab8d1f 100644 --- a/requirements-common.txt +++ b/requirements-common.txt @@ -1,5 +1,5 @@ requests==2.23.0 -onap_dcae_cbs_docker_client==1.0.1 +onap_dcae_cbs_docker_client==2.2.1 six==1.15.0 PyYAML==5.4 httplib2==0.19.0 diff --git a/setup.py b/setup.py index 1563204..a5d581a 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2021 AT&T Intellectual Property. All rights reserved. # Copyright (c) 2021 Samsung Electronics. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); @@ -40,7 +40,7 @@ setup( packages=find_packages(), install_requires=[ "requests==2.23.0", - "onap_dcae_cbs_docker_client==1.0.1", + "onap_dcae_cbs_docker_client==2.2.1", "six==1.15.0", "PyYAML==5.4", "httplib2==0.19.0", -- cgit 1.2.3-korg