summaryrefslogtreecommitdiffstats
path: root/result_collection_api/opnfv_testapi/common
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2016-06-09 02:10:01 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2016-06-09 02:17:39 +0800
commite3c312c23b45f50b583f42dadfa15f60a7544359 (patch)
treec70dc2d88a83955ddce71e7ce8c37aa7c2f5422b /result_collection_api/opnfv_testapi/common
parent629bdee7b5acc4eb078395f6c933bfd6391a3d4c (diff)
solve access testresults.opnfv.org/swagger/spec.html fail issue in testAPI
add swagger configuration in config.ini add swagger.docs() process in server.py add swagger configuration parse in config.py add basePath() in settings.py change 'basePath' item assignment in views.py JIRA: FUNCTEST-305 Change-Id: I049991d4d53b78755ee971021ec0ad2458f5da60 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'result_collection_api/opnfv_testapi/common')
-rw-r--r--result_collection_api/opnfv_testapi/common/config.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/result_collection_api/opnfv_testapi/common/config.py b/result_collection_api/opnfv_testapi/common/config.py
index c444e67..ecab88a 100644
--- a/result_collection_api/opnfv_testapi/common/config.py
+++ b/result_collection_api/opnfv_testapi/common/config.py
@@ -37,6 +37,7 @@ class APIConfig:
self.api_port = None
self.api_debug_on = None
self._parser = None
+ self.swagger_base_url = None
def _get_parameter(self, section, param):
try:
@@ -78,6 +79,7 @@ class APIConfig:
obj.api_port = obj._get_int_parameter("api", "port")
obj.api_debug_on = obj._get_bool_parameter("api", "debug")
+ obj.swagger_base_url = obj._get_parameter("swagger", "base_url")
return obj
@@ -85,7 +87,9 @@ class APIConfig:
return "mongo_url = %s \n" \
"mongo_dbname = %s \n" \
"api_port = %s \n" \
- "api_debug_on = %s \n" % (self.mongo_url,
- self.mongo_dbname,
- self.api_port,
- self.api_debug_on)
+ "api_debug_on = %s \n" \
+ "swagger_base_url = %s \n" % (self.mongo_url,
+ self.mongo_dbname,
+ self.api_port,
+ self.api_debug_on,
+ self.swagger_base_url)