Do not execute certificate handlers in update-status hook
The certificate handler code does a bit of work and should not
run during the update-status hook.
As documented in the charms.reactive dispatch [0] function
handlers registered with the @hook decorator will execute before
other handlers. So we can rely on the 'is-update-status-hook'
flag being consistently set when in update-status hook before
other handlers are evaluated for dispatch.
0: 3d27f3d24a/charms/reactive/bus.py (L325)
Closes-Bug: #1954748
Change-Id: I4a3aa544f98049c83db576f95de826038e8e1afc
This commit is contained in:
parent
5999eeaa5d
commit
93bc9e1837
@ -125,6 +125,7 @@ def default_post_series_upgrade():
|
|||||||
|
|
||||||
@reactive.when('certificates.available',
|
@reactive.when('certificates.available',
|
||||||
'charms.openstack.do-default-certificates.available')
|
'charms.openstack.do-default-certificates.available')
|
||||||
|
@reactive.when_not('is-update-status-hook')
|
||||||
def default_request_certificates():
|
def default_request_certificates():
|
||||||
"""When the certificates interface is available, this default handler
|
"""When the certificates interface is available, this default handler
|
||||||
requests TLS certificates.
|
requests TLS certificates.
|
||||||
@ -141,6 +142,7 @@ def default_request_certificates():
|
|||||||
@reactive.when_any(
|
@reactive.when_any(
|
||||||
'certificates.ca.changed',
|
'certificates.ca.changed',
|
||||||
'certificates.certs.changed')
|
'certificates.certs.changed')
|
||||||
|
@reactive.when_not('is-update-status-hook')
|
||||||
def default_configure_certificates():
|
def default_configure_certificates():
|
||||||
"""When the certificates interface is available, this default handler
|
"""When the certificates interface is available, this default handler
|
||||||
updates on-disk certificates and switches on the TLS support.
|
updates on-disk certificates and switches on the TLS support.
|
||||||
|
Loading…
Reference in New Issue
Block a user