Merge lp://qastaging/~gandelman-a/charm-helpers/openstack_utils into lp://qastaging/charm-helpers

Proposed by Adam Gandelman
Status: Merged
Merged at revision: 46
Proposed branch: lp://qastaging/~gandelman-a/charm-helpers/openstack_utils
Merge into: lp://qastaging/charm-helpers
Diff against target: 267 lines (+104/-23)
2 files modified
charmhelpers/contrib/openstack/openstack_utils.py (+42/-14)
tests/contrib/openstack/test_openstack_utils.py (+62/-9)
To merge this branch: bzr merge lp://qastaging/~gandelman-a/charm-helpers/openstack_utils
Reviewer Review Type Date Requested Status
James Page Approve
Adam Gandelman (community) Needs Resubmitting
Review via email: mp+173273@code.qastaging.launchpad.net

Commit message

Add contrib.opentstack.openstack_utils.openstack_upgrade_available()
Allow for non-fatal querying of openstack packages that are not installed
Adds relevant tests.

Description of the change

Adds a utility openstack_upgrade_available() to check if an upgrade is available via the configured installation source. Requires an update to the version querying utilities to be optionally non-fatal.

To post a comment you must log in.
Revision history for this message
James Page (james-page) wrote :

Minor lint:

tests/contrib/openstack/test_openstack_utils.py:60:38: E241 multiple spaces after ','
tests/contrib/openstack/test_openstack_utils.py:373:1: E303 too many blank lines (3)
make: *** [lint] Error 1

review: Needs Fixing
Revision history for this message
James Page (james-page) wrote :

Please can we switch to core/host for juju log calls:

def juju_log(msg):
    subprocess.check_call(['juju-log', msg])

This is duplicated code now - test can also be dropped.

This is not a blocker right now but it would be great if configure_installation_source could be refactored to use more of the approx same code in the fetch helper.

review: Needs Fixing
Revision history for this message
James Page (james-page) wrote :

Does this work with distro upstream versioning:

  StrictVersion(available_vers) > StrictVersion(cur_vers)

For example, python works towards a major release whereas distro use ~

  2013.2.b1 vs 2013.2~b1

review: Needs Information
46. By Adam Gandelman

Use apt_pkg.version_compare() instead of distutil's StrictVersions.

47. By Adam Gandelman

lint fix.

Revision history for this message
Adam Gandelman (gandelman-a) wrote :

Thanks for catching the DistUtils thing. Opted to use apt_pkg.version_compare there instead. Cleaned up lint, too.

juju_log is still used locally in this helper (via error_out() and elsewhere). I'd prefer to defer that, along with the configure_installation_source refactoring to a later cleanup merge.

review: Needs Resubmitting
Revision history for this message
James Page (james-page) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches