Ensure all settings provided on lxd relation before configuring

This commit is contained in:
James Page 2015-09-22 15:22:50 +01:00
parent 52e826edc4
commit d195ba9a7e
2 changed files with 8 additions and 3 deletions

1
hooks/lxd-relation-changed Symbolic link
View File

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

View File

@ -373,11 +373,15 @@ def neutron_plugin_changed():
CONFIGS.write(NOVA_CONF) CONFIGS.write(NOVA_CONF)
@hooks.hook('lxd-relation-joined') @hooks.hook('lxd-relation-changed')
@restart_on_change(restart_map()) @restart_on_change(restart_map())
def lxd_joined(): def lxd_joined():
settings = relation_get() settings = {
configure_lxd(settings, user='nova') 'lxd_password': relation_get('lxd_password'),
'lxd_address': relation_get('lxd_address'),
}
if all(settings):
configure_lxd(settings, user='nova')
def main(): def main():
try: try: