Fix openstack_upgrade_available failing on unconventional source#705
Fix openstack_upgrade_available failing on unconventional source#705canonical-xavd wants to merge 1 commit intojuju:masterfrom
openstack_upgrade_available failing on unconventional source#705Conversation
Related: LP#1965966
UtkarshBhatthere
left a comment
There was a problem hiding this comment.
The changes look fine to me.
ajkavanagh
left a comment
There was a problem hiding this comment.
Unfortunately, this can't be merged as it changes the behaviour of openstack_upgrade_behaviour(). Please see inline comment. Note, also that the doctring for the function also needs to be changed to indicate the new functionality available. Thanks.
| avail_vers = get_os_version_install_source(src, | ||
| raise_exception=True) |
There was a problem hiding this comment.
I've spent a while staring at this, as it was going around my head, and I then realised that this is changing the nature of openstack_upgrade_availble() from the existing behaviour of erroring out (using error_out() in get_os_version_codename()) to a new behaviour of raising an exception (ValueError).
To fix this, this function (openstack_upgrade_avialble()) should also take an optional raise_exception=False parameter, and whatever calls it should pass in raise_exception=True to get the new behaviour. Otherwise, a whole load of charms may get different behaviour from what they are expecting currently.
An unfortunate follow-up to #688 after digging up a relevant comment clarifying reasons being the previous PR.
Fixes
openstack_upgrade_availablecalls unexpectedlysys.exit(1)ing, while expecting to be thrown an exception, whenever the package source specification does not contain an Openstack release codename.Related change: https://review.opendev.org/c/openstack/charm-keystone/+/835087
Related: LP#1965966