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
=== modified file 'debian/changelog'
--- debian/changelog 2014-04-30 15:02:44 +0000
+++ debian/changelog 2014-07-30 13:16:51 +0000
@@ -1,3 +1,12 @@
1software-properties (0.92.38) utopic; urgency=medium
2
3 * cloudarchive: Teach cloud-archive: prefix which Ubuntu Cloud Archive's
4 map to which Ubuntu releases, adding support for Juno on 14.04
5 (LP: #1350291).
6 * cloudarchive: Tidy messages to have correct capitalization.
7
8 -- James Page <james.page@ubuntu.com> Wed, 30 Jul 2014 12:24:26 +0100
9
1software-properties (0.92.37.1) trusty-proposed; urgency=low10software-properties (0.92.37.1) trusty-proposed; urgency=low
211
3 * software-properties-dbus:12 * software-properties-dbus:
413
=== modified file 'softwareproperties/cloudarchive.py'
--- softwareproperties/cloudarchive.py 2013-10-01 03:03:00 +0000
+++ softwareproperties/cloudarchive.py 2014-07-30 13:16:51 +0000
@@ -28,8 +28,13 @@
2828
29from softwareproperties.shortcuts import ShortcutException29from softwareproperties.shortcuts import ShortcutException
3030
31CODENAME = "precise"31RELEASE_MAP = {
32OS_RELEASES = ('folsom', 'grizzly', 'havana', 'icehouse')32 'folsom': 'precise',
33 'grizzly': 'precise',
34 'havana': 'precise',
35 'icehouse': 'precise',
36 'juno': 'trusty',
37}
33MIRROR = "http://ubuntu-cloud.archive.canonical.com/ubuntu"38MIRROR = "http://ubuntu-cloud.archive.canonical.com/ubuntu"
34UCA = "Ubuntu Cloud Archive"39UCA = "Ubuntu Cloud Archive"
35WEB_LINK = 'https://wiki.ubuntu.com/ServerTeam/CloudArchive'40WEB_LINK = 'https://wiki.ubuntu.com/ServerTeam/CloudArchive'
@@ -37,7 +42,7 @@
37 'ubuntu-cloud-keyring']42 'ubuntu-cloud-keyring']
3843
39ALIASES = {'tools-updates': 'tools'}44ALIASES = {'tools-updates': 'tools'}
40for _r in OS_RELEASES:45for _r in RELEASE_MAP:
41 ALIASES["%s-updates" % _r] = _r46 ALIASES["%s-updates" % _r] = _r
4247
43MAP = {48MAP = {
@@ -49,13 +54,15 @@
49 'description': UCA + " for cloud-tools (JuJu and MAAS) [proposed]"}54 'description': UCA + " for cloud-tools (JuJu and MAAS) [proposed]"}
50}55}
5156
52for _r in OS_RELEASES:57for _r in RELEASE_MAP:
53 MAP[_r] = {58 MAP[_r] = {
54 'sldfmt': '%(codename)s-updates/' + _r,59 'sldfmt': '%(codename)s-updates/' + _r,
55 'description': UCA + ' for ' + 'Openstack ' + _r}60 'description': UCA + ' for ' + 'OpenStack ' + _r.capitalize(),
61 'release': RELEASE_MAP[_r]}
56 MAP[_r + "-proposed"] = {62 MAP[_r + "-proposed"] = {
57 'sldfmt': '%(codename)s-proposed/' + _r,63 'sldfmt': '%(codename)s-proposed/' + _r,
58 'description': UCA + ' for ' + 'Openstack %s [proposed]' % _r}64 'description': UCA + ' for ' + 'OpenStack %s [proposed]' % _r.capitalize(),
65 'release': RELEASE_MAP[_r]}
5966
6067
61class CloudArchiveShortcutHandler(object):68class CloudArchiveShortcutHandler(object):
@@ -73,7 +80,7 @@
7380
74 name_in = shortcut[len(prefix):]81 name_in = shortcut[len(prefix):]
75 caname = ALIASES.get(name_in, name_in)82 caname = ALIASES.get(name_in, name_in)
76 83
77 subs.update({'input_name': name_in})84 subs.update({'input_name': name_in})
78 if caname not in MAP:85 if caname not in MAP:
79 raise ShortcutException(86 raise ShortcutException(
@@ -88,10 +95,12 @@
88 return self._info95 return self._info
8996
90 def expand(self, codename):97 def expand(self, codename):
91 if codename not in (CODENAME, os.environ.get("CA_ALLOW_CODENAME")):98 if codename not in (MAP[self.caname]['release'],
99 os.environ.get("CA_ALLOW_CODENAME")):
92 raise ShortcutException(100 raise ShortcutException(
93 _("cloud-archive only supported on %(codename)s")101 _("cloud-archive for %(os_release)s only supported on %(codename)s")
94 % {'codename': CODENAME})102 % {'codename': MAP[self.caname]['release'],
103 'os_release': self.caname.capitalize()})
95 dist = MAP[self.caname]['sldfmt'] % {'codename': codename}104 dist = MAP[self.caname]['sldfmt'] % {'codename': codename}
96 line = ' '.join(('deb', MIRROR, dist, 'main',))105 line = ' '.join(('deb', MIRROR, dist, 'main',))
97 return (line, _fname_for_caname(self.caname))106 return (line, _fname_for_caname(self.caname))

Subscribers

People subscribed via source and target branches

to status/vote changes: