Open afreiberger opened 5 years ago
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=680891 appears to be the documentation culprit that may have lead to this code.
https://bugs.launchpad.net/charm-swift-proxy/+bug/1817384 has more details on a specific incident with swift-proxy openstack upgrades that hits this issue.
I've had several openstack charms where openstack-upgrade fails to detect an available upgrade due to package revs being more than a single minor-rev jump.
It appears that apt_pkg versions_compare(package, version) now returns +X, 0, or -X based on how many revs difference there is between installed package and the version provided.
The code at https://github.com/juju/charm-helpers/blob/master/charmhelpers/contrib/openstack/utils.py#L659 denotes a true return only if that revision is positive 1 minor version away with this module's upgrade.
An upgrade from Pike to Queens for nova-compute, for example, yields false on openstack_upgrade_available() because apt.version_compare returns '3'. This breaks all openstack-upgrade actions on openstack charms.