diff options
Diffstat (limited to 'python_moonclient')
-rw-r--r-- | python_moonclient/README.md | 8 | ||||
-rw-r--r-- | python_moonclient/python_moonclient/authz.py | 4 | ||||
-rw-r--r-- | python_moonclient/python_moonclient/parse.py | 2 | ||||
-rw-r--r-- | python_moonclient/python_moonclient/pdp.py | 5 | ||||
-rw-r--r-- | python_moonclient/python_moonclient/policies.py | 4 | ||||
-rw-r--r-- | python_moonclient/python_moonclient/scripts.py | 2 | ||||
-rw-r--r-- | python_moonclient/setup.py | 7 |
7 files changed, 15 insertions, 17 deletions
diff --git a/python_moonclient/README.md b/python_moonclient/README.md index d1ebc786..1a9731e7 100644 --- a/python_moonclient/README.md +++ b/python_moonclient/README.md @@ -1,4 +1,4 @@ -# python-moonclient Package +# python-moonclient This package contains the core module for the Moon project. It is designed to provide authorization feature to all OpenStack components. @@ -11,13 +11,13 @@ python_moonutilities is a common Python lib for other Moon Python packages ## Build ### Build Python Package ```bash -cd ${MOON_HOME}/moonv4/python_moonclient +cd ${MOON_HOME}/python_moonclient python3 setup.py sdist bdist_wheel ``` ### Push Python Package to PIP ```bash -cd ${MOON_HOME}/moonv4/python_moonclient +cd ${MOON_HOME}/python_moonclient gpg --detach-sign -u "${GPG_ID}" -a dist/python_moonclient-X.Y.Z-py3-none-any.whl gpg --detach-sign -u "${GPG_ID}" -a dist/python_moonclient-X.Y.Z.tar.gz twine upload dist/python_moonclient-X.Y.Z-py3-none-any.whl dist/python_moonclient-X.Y.Z-py3-none-any.whl.asc @@ -28,6 +28,6 @@ twine upload dist/python_moonclient-X.Y.Z.tar.gz dist/python_moonclient-X.Y.Z.ta ### Python Unit Test launch Docker for Python unit tests ```bash -cd ${MOON_HOME}/moonv4/python_moonclient +cd ${MOON_HOME}/python_moonclient docker run --rm --volume $(pwd):/data wukongsun/moon_python_unit_test:latest ``` diff --git a/python_moonclient/python_moonclient/authz.py b/python_moonclient/python_moonclient/authz.py index 9458767e..b90bf00f 100644 --- a/python_moonclient/python_moonclient/authz.py +++ b/python_moonclient/python_moonclient/authz.py @@ -13,7 +13,7 @@ HOST_KEYSTONE = None PORT_KEYSTONE = None lock = threading.Lock() -logger = logging.getLogger(__name__) +logger = logging.getLogger("moonclient.authz") def _construct_payload(creds, current_rule, enforcer, target): @@ -122,7 +122,7 @@ def send_requests(scenario, authz_host, authz_port, keystone_project_id, request while request_cpt < limit: rule = (random.choice(SUBJECTS), random.choice(OBJECTS), random.choice(ACTIONS)) if destination.lower() == "wrapper": - url = "http://{}:{}/authz".format(authz_host, authz_port) + url = "http://{}:{}/authz/oslo".format(authz_host, authz_port) data = { 'target': { "user_id": random.choice(SUBJECTS), diff --git a/python_moonclient/python_moonclient/parse.py b/python_moonclient/python_moonclient/parse.py index 8960c41c..d31b3ebd 100644 --- a/python_moonclient/python_moonclient/parse.py +++ b/python_moonclient/python_moonclient/parse.py @@ -2,7 +2,7 @@ import logging import argparse -logger = logging.getLogger("python_moonclient.utils.parse") +logger = logging.getLogger("python_moonclient.parse") def parse(): diff --git a/python_moonclient/python_moonclient/pdp.py b/python_moonclient/python_moonclient/pdp.py index e628fe17..6841a276 100644 --- a/python_moonclient/python_moonclient/pdp.py +++ b/python_moonclient/python_moonclient/pdp.py @@ -3,7 +3,8 @@ import logging import requests from python_moonclient import config -logger = logging.getLogger("python_moonclient.utils.pdp") +logger = logging.getLogger("python_moonclient.pdp") + URL = None HEADERS = None KEYSTONE_USER = None @@ -11,8 +12,6 @@ KEYSTONE_PASSWORD = None KEYSTONE_PROJECT = None KEYSTONE_SERVER = None -# config = utils.config.get_config_data() - pdp_template = { "name": "test_pdp", diff --git a/python_moonclient/python_moonclient/policies.py b/python_moonclient/python_moonclient/policies.py index 80210811..0fae63c2 100644 --- a/python_moonclient/python_moonclient/policies.py +++ b/python_moonclient/python_moonclient/policies.py @@ -2,12 +2,10 @@ import logging import requests from . import config, models -logger = logging.getLogger("moonclient.models") +logger = logging.getLogger("moonclient.policies") URL = None HEADERS = None -FILE = open("/tmp/test.log", "w") -logger = logging.getLogger("utils.policies") policy_template = { "name": "test_policy", diff --git a/python_moonclient/python_moonclient/scripts.py b/python_moonclient/python_moonclient/scripts.py index 30759743..c880e497 100644 --- a/python_moonclient/python_moonclient/scripts.py +++ b/python_moonclient/python_moonclient/scripts.py @@ -3,7 +3,7 @@ from importlib.machinery import SourceFileLoader from . import parse, models, policies, pdp, authz -logger = logging.getLogger("python_moonclient.scripts") +logger = logging.getLogger("moonclient.scripts") def get_keystone_projects(): diff --git a/python_moonclient/setup.py b/python_moonclient/setup.py index 1c3ddb80..709e3ffa 100644 --- a/python_moonclient/setup.py +++ b/python_moonclient/setup.py @@ -9,6 +9,7 @@ import python_moonclient with open('requirements.txt') as f: required = f.read().splitlines() + setup( name='python-moonclient', @@ -42,12 +43,12 @@ setup( entry_points={ 'console_scripts': [ 'moon_get_keystone_projects = python_moonclient.scripts:get_keystone_projects', - 'moon_create_pdp = python_moonclient.scripts:create_pdp', 'moon_get_pdp = python_moonclient.scripts:get_pdp', - 'moon_send_authz_to_wrapper = python_moonclient.scripts:send_authz_to_wrapper', + 'moon_create_pdp = python_moonclient.scripts:create_pdp', 'moon_delete_pdp = python_moonclient.scripts:delete_pdp', 'moon_delete_policy = python_moonclient.scripts:delete_policy', - 'moon_map_pdp_to_project = python_moonclient.scripts:map_pdp_to_project' + 'moon_map_pdp_to_project = python_moonclient.scripts:map_pdp_to_project', + 'moon_send_authz_to_wrapper = python_moonclient.scripts:send_authz_to_wrapper' ], } |