diff options
-rw-r--r-- | docker/Dockerfile | 5 | ||||
-rw-r--r-- | osdf/apps/baseapp.py | 23 | ||||
-rw-r--r-- | pom.xml | 4 |
3 files changed, 16 insertions, 16 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile index 0f271c8..e339ea7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -30,7 +30,7 @@ ENV https_proxy $HTTPS_PROXY ENV OSDF_PORT "8699" EXPOSE ${OSDF_PORT} -ENV MZN 2.3.2 +ENV MZN 2.4.2 ENV MZN_BASENAME MiniZincIDE-${MZN}-bundle-linux ENV MZN_GH_BASE https://github.com/MiniZinc/MiniZincIDE ENV MZN_DL_URL ${MZN_GH_BASE}/releases/download/${MZN}/${MZN_BASENAME}-x86_64.tgz @@ -49,8 +49,7 @@ RUN wget -q $MZN_DL_URL -O /tmp/mz.tgz \ && tar xzf /tmp/mz.tgz \ && mv $MZN_BASENAME /mz-dist \ && rm /tmp/mz.tgz \ - && echo PATH=/mz-dist/bin:$PATH >> ~/.bashrc \ - && echo 'export LD_LIBRARY_PATH=/mz-dist/lib:LD_LIBRARY_PATH' >> ~/.bashrc + && echo PATH=/mz-dist/bin:$PATH >> ~/.bashrc ENV SHELL /bin/bash ENV PATH /mz-dist:$PATH diff --git a/osdf/apps/baseapp.py b/osdf/apps/baseapp.py index cfa7e5d..008ce1d 100644 --- a/osdf/apps/baseapp.py +++ b/osdf/apps/baseapp.py @@ -27,18 +27,17 @@ import time import traceback from optparse import OptionParser -import pydevd -from flask import Flask, request, Response, g -from requests import RequestException -from schematics.exceptions import DataError - import osdf.adapters.aaf.sms as sms import osdf.operation.responses +import pydevd +from flask import Flask, request, Response, g from osdf.config.base import osdf_config from osdf.logging.osdf_logging import error_log, debug_log from osdf.operation.error_handling import request_exception_to_json_body, internal_error_message from osdf.operation.exceptions import BusinessException from osdf.utils.mdc_utils import clear_mdc, mdc_from_json, default_mdc +from requests import RequestException +from schematics.exceptions import DataError ERROR_TEMPLATE = osdf.ERROR_TEMPLATE @@ -90,17 +89,19 @@ def handle_data_error(e): @app.before_request def log_request(): g.request_start = time.clock() - if request.get_json(): - - request_json = request.get_json() - g.request_id = request_json['requestInfo']['requestId'] - mdc_from_json(request_json) + if request.data: + if request.get_json(): + request_json = request.get_json() + g.request_id = request_json['requestInfo']['requestId'] + mdc_from_json(request_json) + else: + g.request_id = "N/A" + default_mdc() else: g.request_id = "N/A" default_mdc() - @app.after_request def log_response(response): clear_mdc() @@ -21,7 +21,7 @@ <parent> <groupId>org.onap.oparent</groupId> <artifactId>oparent-python</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.0</version> </parent> <groupId>org.onap.optf.osdf</groupId> @@ -38,7 +38,7 @@ <sonar.language>py</sonar.language> <sonar.pluginname>python</sonar.pluginname> <sonar.inclusions>**/**.py,osdfapp.py</sonar.inclusions> - <sonar.exclusions>test/**.py</sonar.exclusions> + <sonar.exclusions>test/**.py,docs/**.py</sonar.exclusions> <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format> <osdf.build.timestamp>${maven.build.timestamp}</osdf.build.timestamp> <osdf.project.version>${project.version}</osdf.project.version> |