Updates, checkin link.s

This commit is contained in:
Adam Gandelman 2013-10-10 09:04:40 -07:00
parent 0b661186b0
commit ed71ab066c
4 changed files with 32 additions and 19 deletions

View File

@ -490,13 +490,15 @@ class SubordinateConfigContext(OSContextGenerator):
def __call__(self): def __call__(self):
ctxt = {} ctxt = {}
for rid in relation_ids(self.interface): for rid in relation_ids(self.interface):
sub_config = relation_get('subordinate_config', relaton_id=rid) for unit in related_units(rid):
sub_config = relation_get('subordinate_config',
relaton_id=rid, unit=unit)
if sub_config and sub_config != '': if sub_config and sub_config != '':
try: try:
sub_config = json.loads(sub_config) sub_config = json.loads(sub_config)
except: except:
log('Could not parse JSON from subordinate_config setting ' log('Could not parse JSON from subordinate_config '
'from %s' % rid, level=ERROR) 'setting from %s' % rid, level=ERROR)
if self.service not in sub_config: if self.service not in sub_config:
log('Found subordinate_config on %s but it contained' log('Found subordinate_config on %s but it contained'
@ -513,4 +515,7 @@ class SubordinateConfigContext(OSContextGenerator):
for k, v in sub_config.iteritems(): for k, v in sub_config.iteritems():
ctxt[k] = v ctxt[k] = v
if not ctxt:
ctxt['sections'] = {}
return ctxt return ctxt

View File

@ -0,0 +1 @@
nova_cc_hooks.py

View File

@ -0,0 +1 @@
nova_cc_hooks.py

View File

@ -401,6 +401,12 @@ def nova_vmware_relation_joined():
relation_set(network_manager=network_manager()) relation_set(network_manager=network_manager())
@hooks.hook()
@restart_on_change(restart_map())
def nova_vmware_relation_changed():
CONFIGS.write('/etc/nova/nova.conf')
def main(): def main():
try: try:
hooks.execute(sys.argv) hooks.execute(sys.argv)