Remove chance of config-changed running in an infinite loop due to re-exec

This commit is contained in:
Liam Young 2015-10-19 08:16:38 +00:00
parent 686464a8ba
commit a4711763a0
3 changed files with 10 additions and 1 deletions

View File

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

View File

@ -154,6 +154,13 @@ def config_changed():
status_set('maintenance', 'Running openstack upgrade')
do_openstack_upgrade(configs=CONFIGS)
config_changed_postupgrade()
@hooks.hook('config-changed-postupgrade')
@restart_on_change(restart_map())
@synchronize_ca_if_changed(fatal=True)
def config_changed_postupgrade():
# Ensure ssl dir exists and is unison-accessible
ensure_ssl_dir()

View File

@ -395,7 +395,8 @@ def do_openstack_upgrade(configs):
else:
log("Database not ready - deferring to shared-db relation",
level=INFO)
os.execl('./hooks/config-changed', '')
log("Re-execing hook to pickup upgraded packages", level=INFO)
os.execl('./hooks/config-changed-postupgrade', '')
def is_db_initialised():