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
17 help='the component of doctor consumer',
21 help='the ip of consumer',
25 help='the port of doctor consumer',
30 _consumer_name_class_mapping = {
31 'sample': 'consumer.sample.SampleConsumer'
35 def get_consumer(conf, log):
36 consumer_class = _consumer_name_class_mapping.get(conf.consumer.type)
37 return importutils.import_object(consumer_class, conf, log)