Merge lp:~james-page/charm-helpers/fix-ca-sources into lp:charm-helpers

Proposed by James Page
Status: Merged
Merged at revision: 628
Proposed branch: lp:~james-page/charm-helpers/fix-ca-sources
Merge into: lp:charm-helpers
Diff against target: 79 lines (+20/-17)
2 files modified
charmhelpers/fetch/ubuntu.py (+8/-5)
tests/fetch/test_fetch.py (+12/-12)
To merge this branch: bzr merge lp:~james-page/charm-helpers/fix-ca-sources
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+305953@code.launchpad.net

Description of the change

Fixup broken source templates for UCA and proposed pockets.

To post a comment you must log in.
629. By James Page

Fixup associated unit tests

Revision history for this message
Liam Young (gnuoy) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/fetch/ubuntu.py'
2--- charmhelpers/fetch/ubuntu.py 2016-08-10 09:57:19 +0000
3+++ charmhelpers/fetch/ubuntu.py 2016-09-16 13:33:11 +0000
4@@ -24,11 +24,14 @@
5 from charmhelpers.core.hookenv import log
6 from charmhelpers.fetch import SourceConfigError
7
8-CLOUD_ARCHIVE = ('# Ubuntu Cloud Archive deb'
9- ' http://ubuntu-cloud.archive.canonical.com/ubuntu'
10- ' {} main')
11-PROPOSED_POCKET = ('# Proposed deb http://archive.ubuntu.com/ubuntu'
12- ' {}-proposed main universe multiverse restricted')
13+CLOUD_ARCHIVE = """# Ubuntu Cloud Archive
14+deb http://ubuntu-cloud.archive.canonical.com/ubuntu {} main
15+"""
16+
17+PROPOSED_POCKET = """# Proposed
18+deb http://archive.ubuntu.com/ubuntu {}-proposed main universe multiverse restricted
19+"""
20+
21 CLOUD_ARCHIVE_POCKETS = {
22 # Folsom
23 'folsom': 'precise-updates/folsom',
24
25=== modified file 'tests/fetch/test_fetch.py'
26--- tests/fetch/test_fetch.py 2016-08-12 07:09:27 +0000
27+++ tests/fetch/test_fetch.py 2016-09-16 13:33:11 +0000
28@@ -286,9 +286,9 @@
29 imp.reload(fetch)
30
31 source = "cloud:precise-updates/havana"
32- result = ('# Ubuntu Cloud Archive'
33- ' deb http://ubuntu-cloud.archive.canonical.com/ubuntu'
34- ' precise-updates/havana main')
35+ result = ('# Ubuntu Cloud Archive\n'
36+ 'deb http://ubuntu-cloud.archive.canonical.com/ubuntu'
37+ ' precise-updates/havana main\n')
38
39 with patch_open() as (mock_open, mock_file):
40 fetch.add_source(source=source)
41@@ -305,9 +305,9 @@
42 imp.reload(fetch)
43
44 source = "cloud:precise-havana"
45- result = ('# Ubuntu Cloud Archive'
46- ' deb http://ubuntu-cloud.archive.canonical.com/ubuntu'
47- ' precise-updates/havana main')
48+ result = ('# Ubuntu Cloud Archive\n'
49+ 'deb http://ubuntu-cloud.archive.canonical.com/ubuntu'
50+ ' precise-updates/havana main\n')
51 with patch_open() as (mock_open, mock_file):
52 fetch.add_source(source=source)
53 mock_file.write.assert_called_with(result)
54@@ -323,9 +323,9 @@
55 imp.reload(fetch)
56
57 source = "cloud:havana"
58- result = ('# Ubuntu Cloud Archive'
59- ' deb http://ubuntu-cloud.archive.canonical.com/ubuntu'
60- ' precise-updates/havana main')
61+ result = ('# Ubuntu Cloud Archive\n'
62+ 'deb http://ubuntu-cloud.archive.canonical.com/ubuntu'
63+ ' precise-updates/havana main\n')
64 with patch_open() as (mock_open, mock_file):
65 fetch.add_source(source=source)
66 mock_file.write.assert_called_with(result)
67@@ -339,9 +339,9 @@
68 imp.reload(fetch)
69
70 source = "proposed"
71- result = ('# Proposed'
72- ' deb http://archive.ubuntu.com/ubuntu precise-proposed'
73- ' main universe multiverse restricted')
74+ result = ('# Proposed\n'
75+ 'deb http://archive.ubuntu.com/ubuntu precise-proposed'
76+ ' main universe multiverse restricted\n')
77 lsb_release.return_value = {'DISTRIB_CODENAME': 'precise'}
78 with patch_open() as (mock_open, mock_file):
79 fetch.add_source(source=source)

Subscribers

People subscribed via source and target branches