aboutsummaryrefslogtreecommitdiffstats
path: root/config_binding_service/__init__.py
diff options
context:
space:
mode:
authorTommy Carpenter <tommy@research.att.com>2018-03-05 11:25:44 -0500
committerTommy Carpenter <tommy@research.att.com>2018-03-05 11:34:03 -0500
commit914d8ccb42befc04ec5b759dd84b242591bb5e91 (patch)
tree8a309014aece91b2afbcd5c7b4c3f4160c584d5c /config_binding_service/__init__.py
parent16841e4acee2cc31558bdaf618d68e4349c06168 (diff)
Enforce most pep8 compliance in tox
Also fix some pep8 failings Change-Id: I6904c171c898d510ac2b7e2435b5a80dcdf1be13 Issue-ID: DCAEGEN2-348 Signed-off-by: Tommy Carpenter <tommy@research.att.com>
Diffstat (limited to 'config_binding_service/__init__.py')
-rw-r--r--config_binding_service/__init__.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/config_binding_service/__init__.py b/config_binding_service/__init__.py
index 5f09f1e..2835511 100644
--- a/config_binding_service/__init__.py
+++ b/config_binding_service/__init__.py
@@ -19,7 +19,7 @@
import os
import logging
-'''Configures the module root logger'''
+# Configures the module root logger
root = logging.getLogger()
if root.handlers:
root.handlers.clear()
@@ -29,13 +29,19 @@ handler.setFormatter(formatter)
root.addHandler(handler)
root.setLevel("DEBUG")
+
class BadEnviornmentENVNotFound(Exception):
+ """
+ Specific exception to be raised when a required ENV varaible is missing
+ """
pass
+
def get_logger(module=None):
'''Returns a module-specific logger or global logger if the module is None'''
return root if module is None else root.getChild(module)
+
def get_consul_uri():
"""
This method waterfalls reads an envioronmental variable called CONSUL_HOST
@@ -48,5 +54,3 @@ def get_consul_uri():
return "http://{0}:{1}".format(os.environ["CONSUL_HOST"], 8500)
else:
raise BadEnviornmentENVNotFound("CONSUL_HOST")
-
-