diff --git a/config.yaml b/config.yaml index 1a47b621..3fa34ff7 100644 --- a/config.yaml +++ b/config.yaml @@ -36,6 +36,12 @@ options: rbd pool has been created, changing this value will not have any effect (although it can be changed in ceph by manually configuring your ceph cluster). + use-syslog: + type: boolean + default: False + description: | + By default, all services will log into their corresponding log files. + Setting this to True will force all services to log to the syslog. # HA configuration settings vip: type: string diff --git a/hooks/glance_contexts.py b/hooks/glance_contexts.py index 48824a4a..0b759e16 100644 --- a/hooks/glance_contexts.py +++ b/hooks/glance_contexts.py @@ -2,6 +2,7 @@ from charmhelpers.core.hookenv import ( is_relation_made, relation_ids, service_name, + config ) from charmhelpers.contrib.openstack.context import ( @@ -75,3 +76,11 @@ class ApacheSSLContext(SSLContext): def __call__(self): return super(ApacheSSLContext, self).__call__() + + +class GlanceContext(OSContextGenerator): + def __call__(self): + ctxt = { + 'use_syslog': config('use-syslog') + } + return ctxt diff --git a/hooks/glance_utils.py b/hooks/glance_utils.py index 4f1fca9e..7ce59a08 100755 --- a/hooks/glance_utils.py +++ b/hooks/glance_utils.py @@ -63,7 +63,8 @@ TEMPLATES = 'templates/' CONFIG_FILES = OrderedDict([ (GLANCE_REGISTRY_CONF, { 'hook_contexts': [context.SharedDBContext(), - context.IdentityServiceContext()], + context.IdentityServiceContext(), + glance_contexts.GlanceContext()], 'services': ['glance-registry'] }), (GLANCE_API_CONF, { @@ -72,7 +73,8 @@ CONFIG_FILES = OrderedDict([ context.IdentityServiceContext(), glance_contexts.CephGlanceContext(), glance_contexts.ObjectStoreContext(), - glance_contexts.HAProxyContext()], + glance_contexts.HAProxyContext(), + glance_contexts.GlanceContext()], 'services': ['glance-api'] }), (GLANCE_API_PASTE_INI, { diff --git a/revision b/revision index c748b568..0d667b5e 100644 --- a/revision +++ b/revision @@ -1 +1 @@ -147 +148 diff --git a/templates/essex/glance-api.conf b/templates/essex/glance-api.conf index f694af9a..be405c8a 100644 --- a/templates/essex/glance-api.conf +++ b/templates/essex/glance-api.conf @@ -1,5 +1,6 @@ [DEFAULT] verbose = True +use_syslog = {{ use_syslog }} debug = True {% if rbd_pool %} default_store = rbd diff --git a/templates/folsom/glance-api.conf b/templates/folsom/glance-api.conf index 817dccfa..ea11bdec 100644 --- a/templates/folsom/glance-api.conf +++ b/templates/folsom/glance-api.conf @@ -1,5 +1,6 @@ [DEFAULT] verbose = True +use_syslog = {{ use_syslog }} debug = True {% if rbd_pool %} default_store = rbd diff --git a/templates/glance-registry.conf b/templates/glance-registry.conf index 4686b841..b9b90904 100644 --- a/templates/glance-registry.conf +++ b/templates/glance-registry.conf @@ -1,5 +1,6 @@ [DEFAULT] verbose = True +use_syslog = {{ use_syslog }} debug = True bind_host = 0.0.0.0 bind_port = 9191