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
=== modified file 'charmhelpers/fetch/ubuntu.py'
--- charmhelpers/fetch/ubuntu.py 2016-08-10 09:57:19 +0000
+++ charmhelpers/fetch/ubuntu.py 2016-09-16 13:33:11 +0000
@@ -24,11 +24,14 @@
24from charmhelpers.core.hookenv import log24from charmhelpers.core.hookenv import log
25from charmhelpers.fetch import SourceConfigError25from charmhelpers.fetch import SourceConfigError
2626
27CLOUD_ARCHIVE = ('# Ubuntu Cloud Archive deb'27CLOUD_ARCHIVE = """# Ubuntu Cloud Archive
28 ' http://ubuntu-cloud.archive.canonical.com/ubuntu'28deb http://ubuntu-cloud.archive.canonical.com/ubuntu {} main
29 ' {} main')29"""
30PROPOSED_POCKET = ('# Proposed deb http://archive.ubuntu.com/ubuntu'30
31 ' {}-proposed main universe multiverse restricted')31PROPOSED_POCKET = """# Proposed
32deb http://archive.ubuntu.com/ubuntu {}-proposed main universe multiverse restricted
33"""
34
32CLOUD_ARCHIVE_POCKETS = {35CLOUD_ARCHIVE_POCKETS = {
33 # Folsom36 # Folsom
34 'folsom': 'precise-updates/folsom',37 'folsom': 'precise-updates/folsom',
3538
=== modified file 'tests/fetch/test_fetch.py'
--- tests/fetch/test_fetch.py 2016-08-12 07:09:27 +0000
+++ tests/fetch/test_fetch.py 2016-09-16 13:33:11 +0000
@@ -286,9 +286,9 @@
286 imp.reload(fetch)286 imp.reload(fetch)
287287
288 source = "cloud:precise-updates/havana"288 source = "cloud:precise-updates/havana"
289 result = ('# Ubuntu Cloud Archive'289 result = ('# Ubuntu Cloud Archive\n'
290 ' deb http://ubuntu-cloud.archive.canonical.com/ubuntu'290 'deb http://ubuntu-cloud.archive.canonical.com/ubuntu'
291 ' precise-updates/havana main')291 ' precise-updates/havana main\n')
292292
293 with patch_open() as (mock_open, mock_file):293 with patch_open() as (mock_open, mock_file):
294 fetch.add_source(source=source)294 fetch.add_source(source=source)
@@ -305,9 +305,9 @@
305 imp.reload(fetch)305 imp.reload(fetch)
306306
307 source = "cloud:precise-havana"307 source = "cloud:precise-havana"
308 result = ('# Ubuntu Cloud Archive'308 result = ('# Ubuntu Cloud Archive\n'
309 ' deb http://ubuntu-cloud.archive.canonical.com/ubuntu'309 'deb http://ubuntu-cloud.archive.canonical.com/ubuntu'
310 ' precise-updates/havana main')310 ' precise-updates/havana main\n')
311 with patch_open() as (mock_open, mock_file):311 with patch_open() as (mock_open, mock_file):
312 fetch.add_source(source=source)312 fetch.add_source(source=source)
313 mock_file.write.assert_called_with(result)313 mock_file.write.assert_called_with(result)
@@ -323,9 +323,9 @@
323 imp.reload(fetch)323 imp.reload(fetch)
324324
325 source = "cloud:havana"325 source = "cloud:havana"
326 result = ('# Ubuntu Cloud Archive'326 result = ('# Ubuntu Cloud Archive\n'
327 ' deb http://ubuntu-cloud.archive.canonical.com/ubuntu'327 'deb http://ubuntu-cloud.archive.canonical.com/ubuntu'
328 ' precise-updates/havana main')328 ' precise-updates/havana main\n')
329 with patch_open() as (mock_open, mock_file):329 with patch_open() as (mock_open, mock_file):
330 fetch.add_source(source=source)330 fetch.add_source(source=source)
331 mock_file.write.assert_called_with(result)331 mock_file.write.assert_called_with(result)
@@ -339,9 +339,9 @@
339 imp.reload(fetch)339 imp.reload(fetch)
340340
341 source = "proposed"341 source = "proposed"
342 result = ('# Proposed'342 result = ('# Proposed\n'
343 ' deb http://archive.ubuntu.com/ubuntu precise-proposed'343 'deb http://archive.ubuntu.com/ubuntu precise-proposed'
344 ' main universe multiverse restricted')344 ' main universe multiverse restricted\n')
345 lsb_release.return_value = {'DISTRIB_CODENAME': 'precise'}345 lsb_release.return_value = {'DISTRIB_CODENAME': 'precise'}
346 with patch_open() as (mock_open, mock_file):346 with patch_open() as (mock_open, mock_file):
347 fetch.add_source(source=source)347 fetch.add_source(source=source)

Subscribers

People subscribed via source and target branches