1 ##############################################################################
2 # Copyright (c) 2018 Nokia Corporation and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 from oslo_config import cfg
10 from oslo_utils import importutils
15 default=os.environ.get('ADMIN_TOOL_TYPE', 'sample'),
16 choices=['sample', 'fenix'],
17 help='the component of doctor admin_tool',
21 help='the ip of admin_tool',
25 help='the port of doctor admin_tool',
30 _admin_tool_name_class_mapping = {
31 'sample': 'doctor_tests.admin_tool.sample.SampleAdminTool'
35 def get_admin_tool(trasport_url, conf, log):
36 admin_tool_class = _admin_tool_name_class_mapping.get(conf.admin_tool.type)
37 return importutils.import_object(admin_tool_class, trasport_url, conf, log)