summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/cmd
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-05-12 17:02:35 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2017-05-12 17:07:47 +0800
commite401fd7efbf74c7cdc5334c380c79b45ad9271e0 (patch)
treec94c4147b3ee71479abbec8be7165367734a4781 /testapi/opnfv_testapi/cmd
parent909be5b53a6141f84480dc29eb5dbfffe5c35fad (diff)
refactor config parser to facilitate adding new configs
refactor hardcoded config.py to facilitate adding new configurations come along with web portal and Authentication features Change-Id: Ibc16166ade0d6e730bb4c9d81e9b9bc9b297faa1 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testapi/opnfv_testapi/cmd')
-rw-r--r--testapi/opnfv_testapi/cmd/server.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/testapi/opnfv_testapi/cmd/server.py b/testapi/opnfv_testapi/cmd/server.py
index fa2b722..8b092b8 100644
--- a/testapi/opnfv_testapi/cmd/server.py
+++ b/testapi/opnfv_testapi/cmd/server.py
@@ -48,7 +48,9 @@ def parse_config(argv=[]):
parser.add_argument("-c", "--config-file", dest='config_file',
help="Config file location")
args = parser.parse_args(argv)
- CONF = config.APIConfig().parse(args.config_file)
+ if args.config_file:
+ config.Config.CONFIG = args.config_file
+ CONF = config.Config()
def get_db():
@@ -60,8 +62,8 @@ def make_app():
return swagger.Application(
url_mappings.mappings,
db=get_db(),
- debug=CONF.api_debug_on,
- auth=CONF.api_authenticate_on
+ debug=CONF.api_debug,
+ auth=CONF.api_authenticate
)