← Back to team overview

livepatch-charmers team mailing list archive

Re: [Merge] ~barryprice/canonical-livepatch-charm/+git/canonical-livepatch-charm:master into canonical-livepatch-charm:master

 

Review: Approve

This is ok.

You will likely get a spurious 'snap refresh' run immediately after the snap installation. I believe the config.changed.snap_channel flag will always be set in the install hook. If you want to fix this, the solution I see is unfortunately a bit of an anti-pattern:

from charms.reactive import register_trigger

register_trigger(when='config.changed.snap_channel', set_flag='livepatch.needs_refresh')
register_trigger(when='snap.installed.canonical-livepatch', clear_flag='livepatch.needs_refresh')

@when('snap.installed.canonical-livepatch', 'livepatch.needs_refresh')
def change_channel():
   [...]
   reactive.clear_flag('livepatch.needs_refresh')
-- 
https://code.launchpad.net/~barryprice/canonical-livepatch-charm/+git/canonical-livepatch-charm/+merge/354942
Your team Livepatch charm developers is subscribed to branch canonical-livepatch-charm:master.


References