summaryrefslogtreecommitdiffstats
path: root/onap-dcae-cbs-docker-client/onap_dcae_cbs_docker_client/client.py
diff options
context:
space:
mode:
authorTommy Carpenter <tommy@research.att.com>2017-09-25 11:45:12 -0400
committerTommy Carpenter <tommy@research.att.com>2017-09-25 15:49:46 +0000
commit7b31008280fa8b5d45af59f6fd86d49293f14abc (patch)
tree314b8aee8dba5a5ccfb7ea35b599e2eec918c1de /onap-dcae-cbs-docker-client/onap_dcae_cbs_docker_client/client.py
parente11be5dc15e6800ed6111b7773b9e44571343207 (diff)
Add unit testing to cbs docker client
Issue-ID: DCAEGEN2-60 Change-Id: I4e376ed2b417aceb2927997ff9be8e502829fd86 Signed-off-by: Tommy Carpenter <tommy@research.att.com>
Diffstat (limited to 'onap-dcae-cbs-docker-client/onap_dcae_cbs_docker_client/client.py')
-rw-r--r--onap-dcae-cbs-docker-client/onap_dcae_cbs_docker_client/client.py12
1 files changed, 6 insertions, 6 deletions
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 4423995..ce9ac74 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
@@ -41,7 +41,7 @@ def _get_uri_from_consul(consul_url, name):
logger.error("Exception occured when querying Consul: either could not hit {0} or no service registered. Error code: {1}, Error Text: {2}".format(url, res.status_code, res.text))
return None
-def _get_envs():
+def _get_envs():
"""
Returns HOSTNAME, CONSUL_HOST, CONFIG_BINDING_SERVICE or crashes for caller to deal with
"""
@@ -53,15 +53,15 @@ def _get_envs():
def get_config():
"""
This call does not raise an exception if Consul or the CBS cannot complete the request.
- It logs an error and returns {} if the config is not bindable.
- It could be a temporary network outage. Call me again later.
+ It logs an error and returns {} if the config is not bindable.
+ It could be a temporary network outage. Call me again later.
- It will raise an exception if the necessary env parameters were not set because that is irrecoverable.
+ It will raise an exception if the necessary env parameters were not set because that is irrecoverable.
This function is called in my /heatlhcheck, so this will be caught early.
"""
-
+
config = {}
-
+
HOSTNAME, CONSUL_HOST = _get_envs()
#not sure how I as the component developer is supposed to know consul port