def register_configs():
"""
Register config files with their respective contexts.
Regstration of some configs may not be required depending on
existing of certain relations.
"""
# if called without anything installed (eg during install hook)
# just default to earliest supported release. configs dont get touched
# till post-install, anyway.
release = (get_os_codename_package('ceilometer-common', fatal=False) or
'grizzly')
configs = templating.OSConfigRenderer(templates_dir=TEMPLATES,
openstack_release=release)
for conf in (CEILOMETER_CONF, HAPROXY_CONF):
configs.register(conf, CONFIG_FILES[conf]['hook_contexts'])
if init_is_systemd():
configs.register(
CEILOMETER_API_SYSTEMD_CONF,
CONFIG_FILES[CEILOMETER_API_SYSTEMD_CONF]['hook_contexts']
)
if os.path.exists('/etc/apache2/conf-available'):
configs.register(HTTPS_APACHE_24_CONF,
CONFIG_FILES[HTTPS_APACHE_24_CONF]['hook_contexts'])
else:
configs.register(HTTPS_APACHE_CONF,
CONFIG_FILES[HTTPS_APACHE_CONF]['hook_contexts'])
if enable_memcache(release=release):
configs.register(MEMCACHED_CONF, [context.MemcacheContext()])
if run_in_apache():
wsgi_script = "/usr/share/ceilometer/app.wsgi"
configs.register(WSGI_CEILOMETER_API_CONF,
[context.WSGIWorkerConfigContext(name="ceilometer",
script=wsgi_script),
CeilometerContext(),
HAProxyContext()])
return configs
评论列表
文章目录