sample: stop using global conf

Since the sample_source is just a default for the Sample
constructor, their is no need to pass cfg.CONF everywhere in
ceilometer just for this. Instead we prepare the defaults of
the Sample class in prepare_service().

Change-Id: Ie94ec4fece117341569d327fbe8eaaa2fb74b5f6
This commit is contained in:
Mehdi Abaakouk
2016-10-12 11:33:19 +02:00
parent 336fffe3f1
commit 52b1f07d1f
2 changed files with 11 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ from oslo_reports import guru_meditation_report as gmr
from ceilometer.conf import defaults
from ceilometer import keystone_client
from ceilometer import messaging
from ceilometer import sample
from ceilometer import version
OPTS = [
@@ -86,6 +87,8 @@ def prepare_service(argv=None, config_files=None, conf=None):
ka_loading.load_auth_from_conf_options(conf, "service_credentials")
log.setup(conf, 'ceilometer')
sample.setup(conf)
# NOTE(liusheng): guru cannot run with service under apache daemon, so when
# ceilometer-api running with mod_wsgi, the argv is [], we don't start
# guru.