Merge lp:~james-page/software-properties/juno-support into lp:software-properties

Proposed by James Page
Status: Merged
Merged at revision: 907
Proposed branch: lp:~james-page/software-properties/juno-support
Merge into: lp:software-properties
Diff against target: 89 lines (+28/-10)
2 files modified
debian/changelog (+9/-0)
softwareproperties/cloudarchive.py (+19/-10)
To merge this branch: bzr merge lp:~james-page/software-properties/juno-support
Reviewer Review Type Date Requested Status
Scott Moser Approve
Review via email: mp+228828@code.launchpad.net

Description of the change

Add support for cloud-archive:juno

To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :

This looks fine to me. other than I wouldnt just drop CA_ALLOW_CODENAME function.
obviously its of little value, but it allows you to easily just test on something other than LTS.

review: Approve
905. By James Page

Restore CA_ALLOW_CODENAME

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-04-30 15:02:44 +0000
3+++ debian/changelog 2014-07-30 13:16:51 +0000
4@@ -1,3 +1,12 @@
5+software-properties (0.92.38) utopic; urgency=medium
6+
7+ * cloudarchive: Teach cloud-archive: prefix which Ubuntu Cloud Archive's
8+ map to which Ubuntu releases, adding support for Juno on 14.04
9+ (LP: #1350291).
10+ * cloudarchive: Tidy messages to have correct capitalization.
11+
12+ -- James Page <james.page@ubuntu.com> Wed, 30 Jul 2014 12:24:26 +0100
13+
14 software-properties (0.92.37.1) trusty-proposed; urgency=low
15
16 * software-properties-dbus:
17
18=== modified file 'softwareproperties/cloudarchive.py'
19--- softwareproperties/cloudarchive.py 2013-10-01 03:03:00 +0000
20+++ softwareproperties/cloudarchive.py 2014-07-30 13:16:51 +0000
21@@ -28,8 +28,13 @@
22
23 from softwareproperties.shortcuts import ShortcutException
24
25-CODENAME = "precise"
26-OS_RELEASES = ('folsom', 'grizzly', 'havana', 'icehouse')
27+RELEASE_MAP = {
28+ 'folsom': 'precise',
29+ 'grizzly': 'precise',
30+ 'havana': 'precise',
31+ 'icehouse': 'precise',
32+ 'juno': 'trusty',
33+}
34 MIRROR = "http://ubuntu-cloud.archive.canonical.com/ubuntu"
35 UCA = "Ubuntu Cloud Archive"
36 WEB_LINK = 'https://wiki.ubuntu.com/ServerTeam/CloudArchive'
37@@ -37,7 +42,7 @@
38 'ubuntu-cloud-keyring']
39
40 ALIASES = {'tools-updates': 'tools'}
41-for _r in OS_RELEASES:
42+for _r in RELEASE_MAP:
43 ALIASES["%s-updates" % _r] = _r
44
45 MAP = {
46@@ -49,13 +54,15 @@
47 'description': UCA + " for cloud-tools (JuJu and MAAS) [proposed]"}
48 }
49
50-for _r in OS_RELEASES:
51+for _r in RELEASE_MAP:
52 MAP[_r] = {
53 'sldfmt': '%(codename)s-updates/' + _r,
54- 'description': UCA + ' for ' + 'Openstack ' + _r}
55+ 'description': UCA + ' for ' + 'OpenStack ' + _r.capitalize(),
56+ 'release': RELEASE_MAP[_r]}
57 MAP[_r + "-proposed"] = {
58 'sldfmt': '%(codename)s-proposed/' + _r,
59- 'description': UCA + ' for ' + 'Openstack %s [proposed]' % _r}
60+ 'description': UCA + ' for ' + 'OpenStack %s [proposed]' % _r.capitalize(),
61+ 'release': RELEASE_MAP[_r]}
62
63
64 class CloudArchiveShortcutHandler(object):
65@@ -73,7 +80,7 @@
66
67 name_in = shortcut[len(prefix):]
68 caname = ALIASES.get(name_in, name_in)
69-
70+
71 subs.update({'input_name': name_in})
72 if caname not in MAP:
73 raise ShortcutException(
74@@ -88,10 +95,12 @@
75 return self._info
76
77 def expand(self, codename):
78- if codename not in (CODENAME, os.environ.get("CA_ALLOW_CODENAME")):
79+ if codename not in (MAP[self.caname]['release'],
80+ os.environ.get("CA_ALLOW_CODENAME")):
81 raise ShortcutException(
82- _("cloud-archive only supported on %(codename)s")
83- % {'codename': CODENAME})
84+ _("cloud-archive for %(os_release)s only supported on %(codename)s")
85+ % {'codename': MAP[self.caname]['release'],
86+ 'os_release': self.caname.capitalize()})
87 dist = MAP[self.caname]['sldfmt'] % {'codename': codename}
88 line = ' '.join(('deb', MIRROR, dist, 'main',))
89 return (line, _fname_for_caname(self.caname))

Subscribers

People subscribed via source and target branches

to status/vote changes: