diff options
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/cmd/server.py')
-rw-r--r-- | utils/test/testapi/opnfv_testapi/cmd/server.py | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/utils/test/testapi/opnfv_testapi/cmd/server.py b/utils/test/testapi/opnfv_testapi/cmd/server.py index 545d5e367..50ac049a0 100644 --- a/utils/test/testapi/opnfv_testapi/cmd/server.py +++ b/utils/test/testapi/opnfv_testapi/cmd/server.py @@ -29,40 +29,18 @@ TODOs : """ -import argparse -import sys - -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 -CONF = None - - -def parse_config(argv=[]): - global CONF - parser = argparse.ArgumentParser() - parser.add_argument("-c", "--config-file", dest='config_file', - help="Config file location") - args = parser.parse_args(argv) - if args.config_file: - config.Config.CONFIG = args.config_file - CONF = config.Config() - - -def get_db(): - return motor.MotorClient(CONF.mongo_url)[CONF.mongo_dbname] - def make_app(): - swagger.docs(base_url=CONF.swagger_base_url, + swagger.docs(base_url=CONF.ui_url, static_path=CONF.static_path) return swagger.Application( url_mappings.mappings, - db=get_db(), debug=CONF.api_debug, auth=CONF.api_authenticate, cookie_secret='opnfv-testapi', @@ -70,7 +48,6 @@ def make_app(): def main(): - parse_config(sys.argv[1:]) application = make_app() application.listen(CONF.api_port) tornado.ioloop.IOLoop.current().start() |