aboutsummaryrefslogtreecommitdiffstats
path: root/moon_authz
diff options
context:
space:
mode:
authorThomas Duval <thomas.duval@orange.com>2018-01-04 14:41:56 +0100
committerThomas Duval <thomas.duval@orange.com>2018-01-04 14:41:56 +0100
commit295ba85cba341338a2e74fef729dc74d091ac778 (patch)
treec131d0168a9f2ee10792d9257102dc9266175ed1 /moon_authz
parentbb86c23b2b634b855d743e2b005b50391051372b (diff)
update interface pod name to pipeline
Change-Id: I6a5a9ce3a27ea3ea40735dffa5f6a713f571cdc8
Diffstat (limited to 'moon_authz')
-rw-r--r--moon_authz/moon_authz/api/authorization.py2
-rw-r--r--moon_authz/moon_authz/server.py17
2 files changed, 11 insertions, 8 deletions
diff --git a/moon_authz/moon_authz/api/authorization.py b/moon_authz/moon_authz/api/authorization.py
index c83dd72c..ea177d81 100644
--- a/moon_authz/moon_authz/api/authorization.py
+++ b/moon_authz/moon_authz/api/authorization.py
@@ -73,7 +73,7 @@ class Authz(Resource):
return response
def run(self):
- logger.info("self.context.pdp_set={}".format(self.context.pdp_set))
+ logger.debug("self.context.pdp_set={}".format(self.context.pdp_set))
result, message = self.__check_rules()
if result:
return self.__exec_instructions(result)
diff --git a/moon_authz/moon_authz/server.py b/moon_authz/moon_authz/server.py
index 8715bd87..0cc5f6fc 100644
--- a/moon_authz/moon_authz/server.py
+++ b/moon_authz/moon_authz/server.py
@@ -6,7 +6,7 @@
import os
import logging
from moon_authz.http_server import HTTPServer as Server
-from python_moonutilities import configuration
+from python_moonutilities import configuration, exceptions
logger = logging.getLogger("moon.authz.server")
@@ -21,12 +21,15 @@ def create_server():
meta_rule_id = os.getenv("META_RULE_ID")
keystone_project_id = os.getenv("KEYSTONE_PROJECT_ID")
logger.info("component_type={}".format(component_type))
- conf = configuration.get_configuration("plugins/{}".format(component_type))
- conf["plugins/{}".format(component_type)]['id'] = component_id
- hostname = conf["plugins/{}".format(component_type)].get('hostname',
- component_id)
- port = conf["plugins/{}".format(component_type)].get('port', tcp_port)
- bind = conf["plugins/{}".format(component_type)].get('bind', "0.0.0.0")
+ conf = configuration.get_plugins()
+ # conf = configuration.get_configuration("plugins/{}".format(component_type))
+ # conf["plugins/{}".format(component_type)]['id'] = component_id
+ if component_type not in conf:
+ raise exceptions.ConsulComponentNotFound("{} not found".format(
+ component_type))
+ hostname = conf[component_type].get('hostname', component_id)
+ port = conf[component_type].get('port', tcp_port)
+ bind = conf[component_type].get('bind', "0.0.0.0")
logger.info("Starting server with IP {} on port {} bind to {}".format(
hostname, port, bind))