Don't make any changes during update-status hooks
Previously the config_changed function was invoked during the update-status hooks. And it made unnecessary changes to the system. Guard reactive functions properly. > INFO unit.ceph-fs/0.juju-log Invoking reactive handler: > reactive/ceph_fs.py:42:config_changed Closes-Bug: #2074349 Related-Bug: #2071780 Change-Id: If6cd061fef4c3625d6d498942949e31f243622df
This commit is contained in:
parent
ec41cb0e41
commit
032949448f
@ -41,7 +41,7 @@ charm.use_defaults(
|
||||
)
|
||||
|
||||
|
||||
@reactive.when_none('charm.paused', 'run-default-update-status')
|
||||
@reactive.when_none('charm.paused', 'is-update-status-hook')
|
||||
@reactive.when('ceph-mds.pools.available')
|
||||
def config_changed():
|
||||
ceph_mds = reactive.endpoint_from_flag('ceph-mds.pools.available')
|
||||
@ -77,6 +77,7 @@ def config_changed():
|
||||
str(exc))
|
||||
|
||||
|
||||
@reactive.when_none('charm.paused', 'is-update-status-hook')
|
||||
@reactive.when('ceph-mds.connected')
|
||||
def storage_ceph_connected(ceph):
|
||||
ceph_mds = reactive.endpoint_from_flag('ceph-mds.connected')
|
||||
@ -219,7 +220,7 @@ def storage_ceph_connected(ceph):
|
||||
ceph_mds.send_request_if_needed(rq)
|
||||
|
||||
|
||||
@reactive.when_none('charm.paused', 'run-default-update-status')
|
||||
@reactive.when_none('charm.paused', 'is-update-status-hook')
|
||||
@reactive.when('cephfs.configured', 'ceph-mds.pools.available',
|
||||
'cephfs-share.available')
|
||||
def cephfs_share_available():
|
||||
|
@ -47,11 +47,15 @@ class TestRegisteredHooks(test_utils.TestRegisteredHooks):
|
||||
'when_none': {
|
||||
'config_changed': (
|
||||
'charm.paused',
|
||||
'run-default-update-status',
|
||||
'is-update-status-hook',
|
||||
),
|
||||
'storage_ceph_connected': (
|
||||
'charm.paused',
|
||||
'is-update-status-hook',
|
||||
),
|
||||
'cephfs_share_available': (
|
||||
'charm.paused',
|
||||
'run-default-update-status',
|
||||
'is-update-status-hook',
|
||||
),
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user