Merge lp:~gnuoy/charm-helpers/restore-distro-src into lp:charm-helpers

Proposed by Liam Young
Status: Merged
Merged at revision: 237
Proposed branch: lp:~gnuoy/charm-helpers/restore-distro-src
Merge into: lp:charm-helpers
Diff against target: 36 lines (+8/-0)
2 files modified
charmhelpers/fetch/__init__.py (+3/-0)
tests/fetch/test_fetch.py (+5/-0)
To merge this branch: bzr merge lp:~gnuoy/charm-helpers/restore-distro-src
Reviewer Review Type Date Requested Status
James Page Approve
Review via email: mp+238908@code.launchpad.net

Description of the change

The (inadvertent?) removal of distro as a valid source has broken a number of openstack charms. This mp restores it and adds a unit_test to check for it

To post a comment you must log in.
Revision history for this message
James Page (james-page) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/fetch/__init__.py'
2--- charmhelpers/fetch/__init__.py 2014-09-23 16:34:54 +0000
3+++ charmhelpers/fetch/__init__.py 2014-10-20 15:33:24 +0000
4@@ -218,6 +218,7 @@
5 pocket for the release.
6 'cloud:' may be used to activate official cloud archive pockets,
7 such as 'cloud:icehouse'
8+ 'distro' may be used as a noop
9
10 @param key: A key to be added to the system's APT keyring and used
11 to verify the signatures on packages. Ideally, this should be an
12@@ -251,6 +252,8 @@
13 release = lsb_release()['DISTRIB_CODENAME']
14 with open('/etc/apt/sources.list.d/proposed.list', 'w') as apt:
15 apt.write(PROPOSED_POCKET.format(release))
16+ elif source == 'distro':
17+ pass
18 else:
19 raise SourceConfigError("Unknown source: {!r}".format(source))
20
21
22=== modified file 'tests/fetch/test_fetch.py'
23--- tests/fetch/test_fetch.py 2014-09-11 23:11:20 +0000
24+++ tests/fetch/test_fetch.py 2014-10-20 15:33:24 +0000
25@@ -227,6 +227,11 @@
26 source = "propsed" # Minor typo
27 self.assertRaises(fetch.SourceConfigError, fetch.add_source, source)
28
29+ def test_add_distro_source(self):
30+ source = "distro"
31+ # distro is a noop but test validate no exception is thrown
32+ fetch.add_source(source=source)
33+
34 @patch.object(fetch, 'config')
35 @patch.object(fetch, 'add_source')
36 def test_configure_sources_single_source(self, add_source, config):

Subscribers

People subscribed via source and target branches