[FFe] add support for 'cloud-archive:' like 'ppa:' but for cloud archive

Bug #1233486 reported by Scott Moser on 2013-10-01
This bug affects 2 people
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Scott Moser
Scott Moser

Bug Description

=== SRU Info ===
Canonical and Ubuntu support openstack releases and Juju and Maas on 12.04 via the Cloud Archive [1]. Enabling that archive for the user requires installing a package and then modifying /etc/apt/sources.list by hand. This is error prone, and at very least difficult to hand-type.

apt-add-repository is installed in many systems and many Ubuntu users are familiar with it. We'd like to make documentation and enablement easier by allowing the user to simply type:
 apt-add-repository cloud-archive:havana

 [1] https://wiki.ubuntu.com/ServerTeam/CloudArchive

[Test Case]
 * launch an instance or deploy Ubuntu server 12.04
 * run: apt-add-repository -y cloud-archive:havana
 * run: apt-get update
 * run: apt-cache policy python-nova-client
 * verify that the output of apt-cache above shows the cloud-archive package

Additionally, the attached 'precise SRU validate instructions' goes into
further detail on how to test this, and how to verify that the old functionality ('ppa:') still works..

I've also only patched 'apt-add-repository'. Other front ends won't get the support or risk of regression.

softwareproperties/cloudarchive.py is a very straightforward copy/backport from trunk. The only modifcation was the addition of 'ShortcutException' here rather than in softwareproperties/SoftwareProperties.py

[Regression Potential]
The potential for regression in the prepared patch should be very low.
The code path for new code is protected with statements like
   if shortcut.startswith('cloud-archive:')

The attached' test/verification shows that the old path is still functional.

=== Original Bug Report ===
This is a request to add 'cloud-archive:' support to the 'apt-add-repository' command.

The end goal is that we want to do something like this:
 apt-add-repository cloud-archive:havana

And have that:
  install the ubuntu-cloud-keyring
  add the appropriate repos as described at [1]

The token after 'cloud-archive' would be either an openstack release, OS_RELEASE-proposed, or 'tools' or 'tools-proposed.

The cloud-archive is only supported on precise, so in the end we want this SRU'd also. The branch linked will raise exception if the user tries to add the repo on something other than precise.

The linked branch passes tests and was reviewed by upstream maintainer. It was also done with the eye towards not breaking existing users of either the python api, the kde or gtk or cli frontends.

In the comments below, I've walked through most of the function of 'apt-add-repository' to make sure nothing was broken. Luckily this is a fairly simple command and there is not a lot of paths through the code.

[1] https://wiki.ubuntu.com/ServerTeam/CloudArchive

Related branches

Scott Moser (smoser) on 2013-10-01
affects: ubuntu → software-properties (Ubuntu)
Scott Moser (smoser) on 2013-10-04
description: updated
Scott Moser (smoser) on 2013-10-05
Changed in software-properties (Ubuntu):
assignee: nobody → Scott Moser (smoser)
importance: Undecided → Medium
status: New → In Progress
Scott Moser (smoser) wrote :

I've just pushed to trunk, and uploaded to ubuntu saucy.

I've tested this like the following:
#fresh launch of saucy instance

sudo apt-get update --quiet
sudo apt-get install --assume-yes --quiet lxc
sudo lxc-create -n source-$r-amd64 -t ubuntu-cloud -- --release=$r --arch=amd64;

sudo lxc-clone --snapshot -B overlayfs -o source-$r-amd64 -n test1-$r; done

# inside

# add the ppa to get new version
sudo apt-add-repository -y ppa:smoser
sudo apt-get update -qy
sudo apt-get install -qy software-properties-common

# verify you're prompted for adding a ppa
# you should see a message with info about the ppa. hit ctrl-c.
# expect it is cancelled
sudo apt-add-repository $TEST_PPA

# add again, this time saying 'yes'
sudo apt-add-repository $TEST_PPA
sudo apt-get update
sudo apt-get install smello
sudo apt-get --purge remove smello

sudo apt-add-repository --remove $TEST_PPA
sudo apt-get update
# look for 'smello' (to verify archive removed)
# this should fail with 'Unable to locate package smello'
apt-cache policy smello

## verify '-y' works.
sudo apt-add-repository -y $TEST_PPA
sudo apt-get update

## verify cloud-archive: things work

# because this is saucy, and cloud archive not supported on saucy
# this should fail. Answer 'y' and then it should fail with
# a message
sudo apt-add-repository cloud-archive:havana

# override with CA_ALLOW_CODENAME
sudo CA_ALLOW_CODENAME=$(lsb_release -sc) apt-add-repository cloud-archive:havana
## This should fail, as the pocket added would be
## saucy-updates/havana which wont exist (precise-updates/havana)
sudo apt-get update

## fix that, and make sure update works. apt-get update should succeed
## with out any problems
sudo sed -i 's,saucy,precise,g' /etc/apt/sources.list.d/cloudarchive-havana.list
sudo apt-get update

## also you should now have the ubuntu-cloud-keyring package installed
dpkg-query --show ubuntu-cloud-keyring

## cleanup outside
sudo lxc-destroy -n test1-saucy

Scott Moser (smoser) wrote :
Scott Moser (smoser) on 2013-10-07
summary: - add support for 'cloud-archive:' like 'ppa:' but for cloud archive
+ [FFe] add support for 'cloud-archive:' like 'ppa:' but for cloud archive
description: updated
Scott Moser (smoser) on 2013-10-08
Changed in software-properties (Ubuntu):
status: In Progress → New
Steve Langasek (vorlon) wrote :

This makes sense to me from an FFe POV, and the diff looks sane. FFe granted.

Changed in software-properties (Ubuntu):
status: New → Triaged
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-properties - 0.92.27

software-properties (0.92.27) saucy; urgency=low

  * support adding cloud-archive repositories using syntax like
    cloud-archive:havana (LP: #1233486)
 -- Scott Moser <email address hidden> Sun, 06 Oct 2013 13:30:54 -0400

Changed in software-properties (Ubuntu):
status: Triaged → Fix Released
Scott Moser (smoser) on 2013-10-08
Changed in software-properties (Ubuntu Precise):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Scott Moser (smoser)
Scott Moser (smoser) on 2013-10-08
description: updated
Scott Moser (smoser) wrote :

I uploaded the linked branch to 12.04 proposed yesterday, its sitting in queue:

Hello Scott, or anyone else affected,

Accepted software-properties into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/software-properties/ in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in software-properties (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Scott Moser (smoser) wrote :

Tagged verification done, heres a typescript showing that.

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-properties -

software-properties ( precise-proposed; urgency=low

  * support adding cloud-archive repositories using syntax like
    cloud-archive:havana from add-apt-repository (LP: #1233486)
 -- Scott Moser <email address hidden> Tue, 08 Oct 2013 13:33:57 -0400

Changed in software-properties (Ubuntu Precise):
status: Fix Committed → Fix Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers