Resync helpers, tidy lint
This commit is contained in:
parent
aa89fb1539
commit
fecd775e8a
@ -25,6 +25,7 @@ from charmhelpers.core.hookenv import (
|
|||||||
unit_get,
|
unit_get,
|
||||||
unit_private_ip,
|
unit_private_ip,
|
||||||
ERROR,
|
ERROR,
|
||||||
|
INFO
|
||||||
)
|
)
|
||||||
|
|
||||||
from charmhelpers.contrib.hahelpers.cluster import (
|
from charmhelpers.contrib.hahelpers.cluster import (
|
||||||
@ -714,7 +715,7 @@ class SubordinateConfigContext(OSContextGenerator):
|
|||||||
self.interface = interface
|
self.interface = interface
|
||||||
|
|
||||||
def __call__(self):
|
def __call__(self):
|
||||||
ctxt = {}
|
ctxt = {'sections': {}}
|
||||||
for rid in relation_ids(self.interface):
|
for rid in relation_ids(self.interface):
|
||||||
for unit in related_units(rid):
|
for unit in related_units(rid):
|
||||||
sub_config = relation_get('subordinate_configuration',
|
sub_config = relation_get('subordinate_configuration',
|
||||||
@ -740,10 +741,14 @@ class SubordinateConfigContext(OSContextGenerator):
|
|||||||
|
|
||||||
sub_config = sub_config[self.config_file]
|
sub_config = sub_config[self.config_file]
|
||||||
for k, v in sub_config.iteritems():
|
for k, v in sub_config.iteritems():
|
||||||
|
if k == 'sections':
|
||||||
|
for section, config_dict in v.iteritems():
|
||||||
|
log("adding section '%s'" % (section))
|
||||||
|
ctxt[k][section] = config_dict
|
||||||
|
else:
|
||||||
ctxt[k] = v
|
ctxt[k] = v
|
||||||
|
|
||||||
if not ctxt:
|
log("%d section(s) found" % (len(ctxt['sections'])), level=INFO)
|
||||||
ctxt['sections'] = {}
|
|
||||||
|
|
||||||
return ctxt
|
return ctxt
|
||||||
|
|
||||||
|
@ -78,5 +78,6 @@ class ApacheSSLContext(SSLContext):
|
|||||||
|
|
||||||
|
|
||||||
class LoggingConfigContext(OSContextGenerator):
|
class LoggingConfigContext(OSContextGenerator):
|
||||||
|
|
||||||
def __call__(self):
|
def __call__(self):
|
||||||
return {'debug': config('debug'), 'verbose': config('verbose')}
|
return {'debug': config('debug'), 'verbose': config('verbose')}
|
||||||
|
Loading…
Reference in New Issue
Block a user