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 ##############################################################################
9 from oslo_config import cfg
10 from oslo_utils import importutils
15 choices=['sample', 'collectd'],
16 help='the type of doctor monitor component',
21 _monitor_name_class_mapping = {
22 'sample': 'doctor_tests.monitor.sample.SampleMonitor',
23 'collectd': 'doctor_tests.monitor.collectd.CollectdMonitor'
26 def get_monitor(conf, inspector_url, log):
27 monitor_class = _monitor_name_class_mapping.get(conf.monitor.type)
28 return importutils.import_object(monitor_class, conf,