livepatch-charmers team mailing list archive
-
livepatch-charmers team
-
Mailing list archive
-
Message #00043
Re: [Merge] ~barryprice/canonical-livepatch-charm/+git/canonical-livepatch-charm:master into canonical-livepatch-charm:master
logging errors doesn't cause the charm to fail.
Diff comments:
> diff --git a/reactive/canonical_livepatch.py b/reactive/canonical_livepatch.py
> index bb9d547..fbdaf01 100644
> --- a/reactive/canonical_livepatch.py
> +++ b/reactive/canonical_livepatch.py
> @@ -214,10 +217,20 @@ def activate_livepatch():
> def livepatch_supported():
> arch = uname()[4]
> opts = layer.options('snap')
> - supported_archs = opts['canonical-livepatch'].pop('supported-architectures', None)
> + supported_archs = opts['canonical-livepatch'].pop(
> + 'supported-architectures',
> + None
> + )
> if supported_archs and arch not in supported_archs:
> - hookenv.log('Livepatch does not currently support this architecture: {}'.format(arch))
> - unit_update('blocked', 'Architecture {} is not supported by livepatch'.format(arch))
> + hookenv.log(
> + 'Livepatch does not currently support {} architecture'.format(
> + arch
> + )
> + )
logging errors does not cause the charm to fail. it just raises the severity of the logged message. which tends to get hidden, but at least we tried.
> + unit_update(
> + 'blocked',
> + 'Architecture {} is not supported by livepatch'.format(arch)
> + )
> if is_container():
> hookenv.log('OS container detected, livepatch is not needed')
> unit_update('blocked', 'Livepatch is not needed in OS containers')
--
https://code.launchpad.net/~barryprice/canonical-livepatch-charm/+git/canonical-livepatch-charm/+merge/331851
Your team Livepatch charm developers is subscribed to branch canonical-livepatch-charm:master.
References