diff options
Diffstat (limited to 'moon_interface')
-rw-r--r-- | moon_interface/Changelog | 4 | ||||
-rw-r--r-- | moon_interface/Dockerfile | 13 | ||||
-rw-r--r-- | moon_interface/moon_interface/__init__.py | 2 | ||||
-rw-r--r-- | moon_interface/moon_interface/authz_requests.py | 1 | ||||
-rw-r--r-- | moon_interface/tests/unit_python/api/test_authz.py | 6 |
5 files changed, 19 insertions, 7 deletions
diff --git a/moon_interface/Changelog b/moon_interface/Changelog index f58682a9..cea475f2 100644 --- a/moon_interface/Changelog +++ b/moon_interface/Changelog @@ -26,3 +26,7 @@ CHANGES 4.3.3 ----- - use the threading capability of Flask app + +4.3.3-1 +----- +- Fix a bug in authz_requests diff --git a/moon_interface/Dockerfile b/moon_interface/Dockerfile index 069346c3..00880496 100644 --- a/moon_interface/Dockerfile +++ b/moon_interface/Dockerfile @@ -1,10 +1,15 @@ FROM python:3 +LABEL Name=Interface +LABEL Description="Interface component for the Moon platform" +LABEL Maintainer="Thomas Duval" +LABEL Url="https://wiki.opnfv.org/display/moon/Moon+Project+Proposal" + +USER root + ADD . /root WORKDIR /root/ -RUN pip3 install -r requirements.txt -RUN if [ -d /root/dist ]; then for FILE in $(ls /root/dist/*.tar.gz); do pip install $FILE --upgrade; done; fi -RUN if [ -d /root/dist ]; then for FILE in $(ls /root/dist/*.whl); do pip install $FILE --upgrade; done; fi -RUN pip3 install . +RUN pip3 install --no-cache-dir -r requirements.txt +RUN pip3 install --no-cache-dir . CMD ["python3", "-m", "moon_interface"]
\ No newline at end of file diff --git a/moon_interface/moon_interface/__init__.py b/moon_interface/moon_interface/__init__.py index 0fb32055..a8cd9455 100644 --- a/moon_interface/moon_interface/__init__.py +++ b/moon_interface/moon_interface/__init__.py @@ -3,4 +3,4 @@ # license which can be found in the file 'LICENSE' in this package distribution # or at 'http://www.apache.org/licenses/LICENSE-2.0'. -__version__ = "4.3.3" +__version__ = "4.3.3-1" diff --git a/moon_interface/moon_interface/authz_requests.py b/moon_interface/moon_interface/authz_requests.py index 2ef0e0a1..c809053b 100644 --- a/moon_interface/moon_interface/authz_requests.py +++ b/moon_interface/moon_interface/authz_requests.py @@ -65,6 +65,7 @@ class AuthzRequest: "(with address - {})".format(req.status_code) ) success = True + break except requests.exceptions.ConnectionError: logger.error("Cannot connect to {}".format( "http://{}:{}/authz".format( diff --git a/moon_interface/tests/unit_python/api/test_authz.py b/moon_interface/tests/unit_python/api/test_authz.py index 052bc9c9..a227a303 100644 --- a/moon_interface/tests/unit_python/api/test_authz.py +++ b/moon_interface/tests/unit_python/api/test_authz.py @@ -23,7 +23,8 @@ def test_authz_true(context): assert "result" in data assert data['result'] is True -def test_authz_False(context): + +def test_authz_false(context): import moon_interface.server server = moon_interface.server.create_server() client = server.app.test_client() @@ -48,7 +49,7 @@ def test_authz_effect_unset(context, set_consul_and_db): set_consul_and_db.register_uri( 'POST', 'http://127.0.0.1:8081/authz', - content = conftest.get_pickled_context_invalid() + content=conftest.get_pickled_context_invalid() ) req = client.get("/authz/{p_id}/{s_id}/{o_id}/{a_id}".format( @@ -63,6 +64,7 @@ def test_authz_effect_unset(context, set_consul_and_db): assert "result" in data assert data['result'] is False + def test_authz_invalid_ip(context, set_consul_and_db): import moon_interface.server server = moon_interface.server.create_server() |