Merge lp:~james-page/charms/precise/keystone/upgrade-charm-fix into lp:~openstack-charmers/charms/precise/keystone/ha-support

Proposed by James Page
Status: Merged
Merged at revision: 68
Proposed branch: lp:~james-page/charms/precise/keystone/upgrade-charm-fix
Merge into: lp:~openstack-charmers/charms/precise/keystone/ha-support
Diff against target: 12 lines (+2/-0)
1 file modified
hooks/keystone_hooks.py (+2/-0)
To merge this branch: bzr merge lp:~james-page/charms/precise/keystone/upgrade-charm-fix
Reviewer Review Type Date Requested Status
Adam Gandelman (community) Approve
Review via email: mp+162311@code.launchpad.net

Description of the change

Fixup for upgrade failures

To post a comment you must log in.
Revision history for this message
Adam Gandelman (gandelman-a) :
review: Approve
Revision history for this message
Adam Gandelman (gandelman-a) wrote :

Approving, though I'm a bit concerned that the call to utils.install() here might trigger an unintended upgrade of some package that would require user interaction. Eg: A newer keystone package has been published since the install hook was run, apt-get update was run out of band, and upgrade_charm() ends up attempting to install the new keystone, which would require user interaction to deal with modfieid configs. I think we can handle this by fixing utils.install() to only install packages that are not yet installed, instead of installing everything again.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/keystone_hooks.py'
2--- hooks/keystone_hooks.py 2013-04-09 18:07:32 +0000
3+++ hooks/keystone_hooks.py 2013-05-03 08:56:30 +0000
4@@ -415,6 +415,8 @@
5
6
7 def upgrade_charm():
8+ # Ensure all required packages are installed
9+ utils.install(*packages)
10 cluster_changed()
11 if cluster.eligible_leader(CLUSTER_RES):
12 utils.juju_log('INFO',

Subscribers

People subscribed via source and target branches