aboutsummaryrefslogtreecommitdiffstats
path: root/moon_wrapper
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_wrapper
parentbb86c23b2b634b855d743e2b005b50391051372b (diff)
update interface pod name to pipeline
Change-Id: I6a5a9ce3a27ea3ea40735dffa5f6a713f571cdc8
Diffstat (limited to 'moon_wrapper')
-rw-r--r--moon_wrapper/moon_wrapper/api/generic.py6
-rw-r--r--moon_wrapper/moon_wrapper/api/oslowrapper.py20
2 files changed, 13 insertions, 13 deletions
diff --git a/moon_wrapper/moon_wrapper/api/generic.py b/moon_wrapper/moon_wrapper/api/generic.py
index 7dd44fb4..498513c7 100644
--- a/moon_wrapper/moon_wrapper/api/generic.py
+++ b/moon_wrapper/moon_wrapper/api/generic.py
@@ -7,13 +7,13 @@ Those API are helping API used to manage the Moon platform.
"""
from flask_restful import Resource, request
-from oslo_log import log as logging
+import logging
import moon_wrapper.api
from python_moonutilities.security_functions import check_auth
__version__ = "0.1.0"
-LOG = logging.getLogger("moon.manager.api." + __name__)
+logger = logging.getLogger("moon.manager.api." + __name__)
class Status(Resource):
@@ -125,7 +125,7 @@ class API(Resource):
if endpoint_id in api_desc[group_id]:
return {group_id: {endpoint_id: api_desc[group_id][endpoint_id]}}
elif len(endpoint_id) > 0:
- LOG.error("Unknown endpoint_id {}".format(endpoint_id))
+ logger.error("Unknown endpoint_id {}".format(endpoint_id))
return {"error": "Unknown endpoint_id {}".format(endpoint_id)}
return {group_id: api_desc[group_id]}
return api_desc
diff --git a/moon_wrapper/moon_wrapper/api/oslowrapper.py b/moon_wrapper/moon_wrapper/api/oslowrapper.py
index a422ee42..03bdfc69 100644
--- a/moon_wrapper/moon_wrapper/api/oslowrapper.py
+++ b/moon_wrapper/moon_wrapper/api/oslowrapper.py
@@ -16,7 +16,7 @@ from python_moonutilities import exceptions
__version__ = "0.1.0"
-LOG = logging.getLogger("moon.wrapper.api." + __name__)
+logger = logging.getLogger("moon.wrapper.api." + __name__)
class OsloWrapper(Resource):
@@ -35,7 +35,7 @@ class OsloWrapper(Resource):
self.TIMEOUT = 5
def post(self):
- LOG.debug("POST {}".format(request.form))
+ logger.debug("POST {}".format(request.form))
response = flask.make_response("False")
if self.manage_data():
response = flask.make_response("True")
@@ -62,16 +62,16 @@ class OsloWrapper(Resource):
@staticmethod
def __get_project_id(target, credentials):
- LOG.info("__get_project_id {}".format(target))
+ logger.info("__get_project_id {}".format(target))
return target.get("project_id", "none")
def get_interface_url(self, project_id):
- LOG.info("project_id {}".format(project_id))
+ logger.debug("project_id {}".format(project_id))
for containers in self.CACHE.containers.values():
- LOG.info("containers {}".format(containers))
+ logger.info("containers {}".format(containers))
for container in containers:
if container.get("keystone_project_id") == project_id:
- if "interface" in container['name']:
+ if "pipeline" in container['name']:
return "http://{}:{}".format(
container['name'],
container['port'])
@@ -80,7 +80,7 @@ class OsloWrapper(Resource):
for containers in self.CACHE.containers.values():
for container in containers:
if container.get("keystone_project_id") == project_id:
- if "interface" in container['name']:
+ if "pipeline" in container['name']:
return "http://{}:{}".format(
container['name'],
container['port'])
@@ -99,11 +99,11 @@ class OsloWrapper(Resource):
_object = self.__get_object(target, credentials)
_action = rule
_project_id = self.__get_project_id(target, credentials)
- LOG.debug("POST with args project={} / "
+ logger.debug("POST with args project={} / "
"subject={} - object={} - action={}".format(
_project_id, _subject, _object, rule))
interface_url = self.get_interface_url(_project_id)
- LOG.debug("interface_url={}".format(interface_url))
+ logger.debug("interface_url={}".format(interface_url))
req = requests.get("{}/authz/{}/{}/{}/{}".format(
interface_url,
_project_id,
@@ -111,7 +111,7 @@ class OsloWrapper(Resource):
_object,
_action
))
- LOG.debug("Get interface {}".format(req.text))
+ logger.debug("Get interface {}".format(req.text))
if req.status_code == 200:
if req.json().get("result", False):
return True