From 83c44e0acaed30f2388a69fd13ec806c38edfd73 Mon Sep 17 00:00:00 2001 From: Stamatis Katsaounis Date: Wed, 28 Nov 2018 10:43:33 +0200 Subject: Improve Docker deployment JIRA: DOVETAIL-755 This patch improves Docker deployment. It removes the extra unwanted container. In addition, it removes unused files. Finally, it fixes the issue of python install where the static files of swagger where not installed inside the api container. Change-Id: Id74c88ab77182ed233f0eedad39ff8da245bb3dd Signed-off-by: Stamatis Katsaounis --- opnfv_testapi/cmd/server.py | 2 +- opnfv_testapi/common/config.py | 4 ---- opnfv_testapi/tests/unit/common/normal.ini | 3 +++ opnfv_testapi/ui/root.py | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) (limited to 'opnfv_testapi') diff --git a/opnfv_testapi/cmd/server.py b/opnfv_testapi/cmd/server.py index d503c8a..fee5877 100644 --- a/opnfv_testapi/cmd/server.py +++ b/opnfv_testapi/cmd/server.py @@ -45,7 +45,7 @@ my_logger.addHandler(handler) def make_app(): swagger.docs(base_url=CONF.swagger_base_url, - static_path=CONF.static_path) + static_path=CONF.ui_static_path) return swagger.Application( url_mappings.mappings, debug=CONF.api_debug, diff --git a/opnfv_testapi/common/config.py b/opnfv_testapi/common/config.py index a6ab338..75bacf3 100644 --- a/opnfv_testapi/common/config.py +++ b/opnfv_testapi/common/config.py @@ -20,10 +20,6 @@ class Config(object): self._set_config_file() self._parse() self._parse_per_page() - self.static_path = os.path.join( - os.path.dirname(os.path.normpath(__file__)), - os.pardir, - 'static') self.base_path = "/home/testapi" def _parse(self): diff --git a/opnfv_testapi/tests/unit/common/normal.ini b/opnfv_testapi/tests/unit/common/normal.ini index 6906913..678cb68 100644 --- a/opnfv_testapi/tests/unit/common/normal.ini +++ b/opnfv_testapi/tests/unit/common/normal.ini @@ -16,3 +16,6 @@ log_file = /dev/null [swagger] base_url = http://localhost:8000 + +[ui] +static_path = /usr/local/share/opnfv_testapi diff --git a/opnfv_testapi/ui/root.py b/opnfv_testapi/ui/root.py index 5b2c922..7f970b2 100644 --- a/opnfv_testapi/ui/root.py +++ b/opnfv_testapi/ui/root.py @@ -4,7 +4,7 @@ from opnfv_testapi.common.config import CONF class RootHandler(GenericApiHandler): def get_template_path(self): - return CONF.static_path + return CONF.ui_static_path def get(self): self.render('testapi-ui/index.html') -- cgit 1.2.3-korg