aboutsummaryrefslogtreecommitdiffstats
path: root/moon_interface/moon_interface/api
diff options
context:
space:
mode:
authorRHE <rebirthmonkey@gmail.com>2017-12-28 15:19:05 +0100
committerRHE <rebirthmonkey@gmail.com>2017-12-28 15:19:05 +0100
commitb7cf76d39eab9d292b8d58db4b0934557cad4509 (patch)
tree556b0e617b5921ad3779b7aed3b669bb475331c6 /moon_interface/moon_interface/api
parent9cf58823b4fa426816acfef81a562054d26afde8 (diff)
moonv4.3 review
Change-Id: I0d137df21136292b58194def44ac5b32183368fc Signed-off-by: RHE <rebirthmonkey@gmail.com>
Diffstat (limited to 'moon_interface/moon_interface/api')
-rw-r--r--moon_interface/moon_interface/api/authz.py35
1 files changed, 1 insertions, 34 deletions
diff --git a/moon_interface/moon_interface/api/authz.py b/moon_interface/moon_interface/api/authz.py
index c9f4697f..a284ff3a 100644
--- a/moon_interface/moon_interface/api/authz.py
+++ b/moon_interface/moon_interface/api/authz.py
@@ -18,7 +18,7 @@ from moon_interface.authz_requests import AuthzRequest
__version__ = "0.1.0"
-LOG = logging.getLogger("moon.interface.api." + __name__)
+LOG = logging.getLogger("moon.interface.api.authz." + __name__)
def pdp_in_cache(cache, uuid):
@@ -45,39 +45,6 @@ def pdp_in_manager(cache, uuid):
return pdp_in_cache(cache, uuid)
-def container_exist(cache, uuid):
- """Check if a PDP exist with this Keystone Project ID in the Manager component
-
- :param cache: Cache to use
- :param uuid: Keystone Project ID
- :return: True or False
- """
- for key, value in cache.containers.items():
- if "keystone_project_id" not in value:
- continue
- if value["keystone_project_id"] == uuid:
- try:
- req = requests.head("http://{}:{}/".format(
- value.get("hostname"),
- value.get("port")[0].get("PublicPort")))
- LOG.info("container_exist {}".format(req.status_code))
- if req.status_code in (200, 201):
- return value
- return
- except requests.exceptions.ConnectionError:
- pass
- # maybe hostname is not working so trying with IP address
- try:
- req = requests.head("http://{}:{}/".format(
- value.get("ip"),
- value.get("port")[0].get("PublicPort")))
- if req.status_code in (200, 201):
- return value
- return
- except requests.exceptions.ConnectionError:
- return
-
-
def create_authz_request(cache, interface_name, manager_url, uuid, subject_name, object_name, action_name):
"""Create the authorization request and make the first call to the Authz function