Skip init_db() and cluster_connected() on update-status

Change-Id: I617b8e4a16129b2023f15b0b841ab263cc5d3589
This commit is contained in:
Felipe Reyes 2023-09-04 21:38:26 -03:00
parent a2e1f8431a
commit 8d512bb7f7
2 changed files with 5 additions and 1 deletions

View File

@ -49,6 +49,7 @@ def render_config(*args):
reactive.set_state('config.rendered')
@reactive.when_not('is-update-status-hook')
@reactive.when_not('db.synced')
@reactive.when('config.rendered')
def init_db():
@ -60,6 +61,7 @@ def init_db():
watcher_charm.assess_status()
@reactive.when_not('is-update-status-hook')
@reactive.when('ha.connected')
def cluster_connected(hacluster):
"""Configure HA resources in corosync"""

View File

@ -41,7 +41,9 @@ class TestRegisteredHooks(test_utils.TestRegisteredHooks):
},
'when_not': {
'auto_upgrade': ('is-update-status-hook',),
'init_db': ('db.synced',),
'cluster_connected': ('is-update-status-hook',),
'init_db': ('db.synced',
'is-update-status-hook'),
}
}
# test that the hooks were registered via the