~rogpeppe/juju-core/502-upgrades-simplify

Viewing all changes in revision 2312.

[r=dimitern],[bug=1240667] Fixed bug #1240667: pin priority for cloud-tools

This introduces several new calls in cloudinit,
which deal with apt sources, their preferences
(/etc/apt/preferences.d/) and packages that we
install from there.

Basically, when deploying a precise machine that
needs to install mongodb-server package, we add
the cloud-tools pocket, but by default this will
add it as an apt source with a higher priority
than the main archive. As a consequence, charms
that try to install packages from main, which
are also in the cloud-tools pocket get the latter,
rather than the former (i.e. the described problem
with python-django's version 1.5 in cloud-tools vs.
1.14 in main, which breaks openstack-dashboard charm).

Now, when adding the cloud-tools archive we also
change its apt preferences, so that its priority
as an apt source is lower than main, which means
when installing mongodb-server during cloudinit
we need to explicitly specity --target-release
'precise-updates/cloud-tools' to pick the version
from cloud-tools.

Live tested on EC2 and works as expected.

https://codereview.appspot.com/61410051/

R=gz, rogpeppe

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: