summaryrefslogtreecommitdiffstats
path: root/utils/test/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
commitd6d15ab17c3427db81ca270b6569d4fb5d347f76 (patch)
tree8bc8fecd5d96e2c07ea4e501653954f9c7a295dd /utils/test/testapi/opnfv_testapi/cmd
parent48603379051c10c4f956a9a1863b169deacbbd04 (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 'utils/test/testapi/opnfv_testapi/cmd')
-rw-r--r--utils/test/testapi/opnfv_testapi/cmd/server.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/utils/test/testapi/opnfv_testapi/cmd/server.py b/utils/test/testapi/opnfv_testapi/cmd/server.py
index fa2b72250..8b092b89e 100644
--- a/utils/test/testapi/opnfv_testapi/cmd/server.py
+++ b/utils/test/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
)