1 #############################################################################
2 # Copyright (c) 2017 ZTE 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 ##############################################################################
11 from oslo_config import cfg
12 from oslo_utils import importutils
14 from doctor_tests.common.constants import Inspector
19 default=os.environ.get('INSPECTOR_TYPE', Inspector.SAMPLE),
20 choices=['sample', 'congress', 'vitrage'],
21 help='the component of doctor inspector',
25 help='the host ip of inspector',
29 help='the port of default for inspector',
31 cfg.BoolOpt('update_neutron_port_dp_status',
33 help='Update data plane status of affected neutron ports',
38 _inspector_name_class_mapping = {
39 Inspector.SAMPLE: 'doctor_tests.inspector.sample.SampleInspector',
40 Inspector.CONGRESS: 'doctor_tests.inspector.congress.CongressInspector',
41 Inspector.VITRAGE: 'doctor_tests.inspector.vitrage.VitrageInspector',
45 def get_inspector(conf, log):
46 inspector_class = _inspector_name_class_mapping[conf.inspector.type]
47 return importutils.import_object(inspector_class, conf, log)