X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=utils%2Ftest%2Ftestapi%2Fopnfv_testapi%2Fcmd%2Fserver.py;h=b7d3caa20800ba74fc98649f466a688e0b49e47c;hb=d818173b634e7f4c910beb7e93dbee3dd032d6d7;hp=013ee6642efdef949d4fc32be6ee92acea05fcbd;hpb=35bf4722a3e84c883fa5212be1bfe3424ad9c3b0;p=releng.git diff --git a/utils/test/testapi/opnfv_testapi/cmd/server.py b/utils/test/testapi/opnfv_testapi/cmd/server.py index 013ee6642..b7d3caa20 100644 --- a/utils/test/testapi/opnfv_testapi/cmd/server.py +++ b/utils/test/testapi/opnfv_testapi/cmd/server.py @@ -29,35 +29,21 @@ TODOs : """ -import argparse - -import motor import tornado.ioloop -from opnfv_testapi.common import config +from opnfv_testapi.common.config import CONF from opnfv_testapi.router import url_mappings from opnfv_testapi.tornado_swagger import swagger -# optionally get config file from command line -parser = argparse.ArgumentParser() -parser.add_argument("-c", "--config-file", dest='config_file', - help="Config file location") -args = parser.parse_args() -CONF = config.APIConfig().parse(args.config_file) - -# connecting to MongoDB server, and choosing database -client = motor.MotorClient(CONF.mongo_url) -db = client[CONF.mongo_dbname] - -swagger.docs(base_url=CONF.swagger_base_url) - def make_app(): + swagger.docs(base_url=CONF.ui_url, + static_path=CONF.ui_static_path) return swagger.Application( url_mappings.mappings, - db=db, - debug=CONF.api_debug_on, - auth=CONF.api_authenticate_on + debug=CONF.api_debug, + auth=CONF.api_authenticate, + cookie_secret='opnfv-testapi', )