aboutsummaryrefslogtreecommitdiffstats
path: root/moon_interface/moon_interface/authz_requests.py
diff options
context:
space:
mode:
authorThomas Duval <thomas.duval@orange.com>2018-01-03 14:23:22 +0100
committerThomas Duval <thomas.duval@orange.com>2018-01-03 14:23:22 +0100
commit17d1bd8c4c8fbd81af85edbde059a28a852a0deb (patch)
tree1a1360e961945f770d3b0feca621ccbf6cd84773 /moon_interface/moon_interface/authz_requests.py
parent52d037e757ac2189978e1129f469929fe73a9b7f (diff)
Clean the code and fix some bugs
Change-Id: I540aeea0af749f86f4c2378864b17d277517b85f
Diffstat (limited to 'moon_interface/moon_interface/authz_requests.py')
-rw-r--r--moon_interface/moon_interface/authz_requests.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/moon_interface/moon_interface/authz_requests.py b/moon_interface/moon_interface/authz_requests.py
index 3f99cb93..87e21152 100644
--- a/moon_interface/moon_interface/authz_requests.py
+++ b/moon_interface/moon_interface/authz_requests.py
@@ -7,11 +7,11 @@ import logging
import itertools
import pickle
import requests
-from python_moonutilities import configuration, exceptions
-from python_moonutilities.security_functions import Context
+from python_moonutilities import exceptions
+from python_moonutilities.context import Context
from python_moonutilities.cache import Cache
-LOG = logging.getLogger("moon.interface.authz_requests")
+logger = logging.getLogger("moon.interface.authz_requests")
CACHE = Cache()
@@ -51,7 +51,7 @@ class AuthzRequest:
req.status_code
))
except requests.exceptions.ConnectionError:
- LOG.error("Cannot connect to {}".format(
+ logger.error("Cannot connect to {}".format(
"http://{}:{}/authz".format(
self.container_chaining[0]["hostip"],
self.container_chaining[0]["port"]
@@ -69,7 +69,7 @@ class AuthzRequest:
req.status_code
))
except requests.exceptions.ConnectionError:
- LOG.error("Cannot connect to {}".format(
+ logger.error("Cannot connect to {}".format(
"http://{}:{}/authz".format(
self.container_chaining[0]["hostname"],
self.container_chaining[0]["port"]
@@ -152,8 +152,3 @@ class AuthzRequest:
return True
self.final_result = "Deny"
return True
-
- # def notify(self, request_id, container_id, payload):
- # LOG.info("notify {} {} {}".format(request_id, container_id, payload))
- # # TODO: send the notification and wait for the result
- # # req = requests.get()