diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2016-06-09 02:10:01 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2016-06-09 02:17:39 +0800 |
commit | cdff7d8d41693971f4c5dc8dd18d6907a5e31937 (patch) | |
tree | c6d0f727acb878544ead1e8a864338490c16d03f /utils/test/result_collection_api/opnfv_testapi/common | |
parent | 354761f94cdd7283740a487d5384ef9b233b66c3 (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 'utils/test/result_collection_api/opnfv_testapi/common')
-rw-r--r-- | utils/test/result_collection_api/opnfv_testapi/common/config.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/utils/test/result_collection_api/opnfv_testapi/common/config.py b/utils/test/result_collection_api/opnfv_testapi/common/config.py index c444e67e3..ecab88ae3 100644 --- a/utils/test/result_collection_api/opnfv_testapi/common/config.py +++ b/utils/test/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) |