Merge lp:~james-page/charm-helpers/openstack-havana-plus into lp:charm-helpers

Proposed by James Page
Status: Merged
Approved by: Adam Gandelman
Approved revision: 53
Merged at revision: 53
Proposed branch: lp:~james-page/charm-helpers/openstack-havana-plus
Merge into: lp:charm-helpers
Diff against target: 89 lines (+20/-6)
2 files modified
charmhelpers/contrib/openstack/utils.py (+8/-3)
tests/contrib/openstack/test_openstack_utils.py (+12/-3)
To merge this branch: bzr merge lp:~james-page/charm-helpers/openstack-havana-plus
Reviewer Review Type Date Requested Status
Charm Helper Maintainers Pending
Review via email: mp+174364@code.launchpad.net

Description of the change

Add versions for swift/havana.

Add pockets for Havana cloud archive.

Use package to import cloud-archive key.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/contrib/openstack/utils.py'
2--- charmhelpers/contrib/openstack/utils.py 2013-07-12 08:18:11 +0000
3+++ charmhelpers/contrib/openstack/utils.py 2013-07-12 08:54:32 +0000
4@@ -16,6 +16,7 @@
5
6 from charmhelpers.core.host import (
7 lsb_release,
8+ apt_install
9 )
10
11 CLOUD_ARCHIVE_URL = "http://ubuntu-cloud.archive.canonical.com/ubuntu"
12@@ -47,6 +48,8 @@
13 '1.7.6': 'grizzly',
14 '1.7.7': 'grizzly',
15 '1.8.0': 'grizzly',
16+ '1.9.0': 'havana',
17+ '1.9.1': 'havana',
18 }
19
20
21@@ -211,7 +214,10 @@
22 'folsom/proposed': 'precise-proposed/folsom',
23 'grizzly': 'precise-updates/grizzly',
24 'grizzly/updates': 'precise-updates/grizzly',
25- 'grizzly/proposed': 'precise-proposed/grizzly'
26+ 'grizzly/proposed': 'precise-proposed/grizzly',
27+ 'havana': 'precise-updates/havana',
28+ 'havana/updates': 'precise-updates/havana',
29+ 'havana/proposed': 'precise-proposed/havana',
30 }
31
32 try:
33@@ -221,8 +227,7 @@
34 error_out(e)
35
36 src = "deb %s %s main" % (CLOUD_ARCHIVE_URL, pocket)
37- # TODO: Replace key import with cloud archive keyring pkg.
38- import_key(CLOUD_ARCHIVE_KEY_ID)
39+ apt_install('ubuntu-cloud-keyring', fatal=True)
40
41 with open('/etc/apt/sources.list.d/cloud-archive.list', 'w') as f:
42 f.write(src)
43
44=== modified file 'tests/contrib/openstack/test_openstack_utils.py'
45--- tests/contrib/openstack/test_openstack_utils.py 2013-07-12 08:18:11 +0000
46+++ tests/contrib/openstack/test_openstack_utils.py 2013-07-12 08:54:32 +0000
47@@ -38,6 +38,11 @@
48 'os_release': 'grizzly',
49 'os_version': '1.7.7'
50 },
51+ 'swift-proxy': {
52+ 'pkg_vers': '1.9.0-0ubuntu1',
53+ 'os_release': 'havana',
54+ 'os_version': '1.9.0'
55+ },
56 # a package thats available in the cache but is not installed
57 'cinder-common': {
58 'os_release': 'havana',
59@@ -60,6 +65,9 @@
60 ('cloud:precise-grizzly/proposed', url + ' precise-proposed/grizzly main'),
61 ('cloud:precise-grizzly', url + ' precise-updates/grizzly main'),
62 ('cloud:precise-grizzly/updates', url + ' precise-updates/grizzly main'),
63+ ('cloud:precise-havana/proposed', url + ' precise-proposed/havana main'),
64+ ('cloud:precise-havana', url + ' precise-updates/havana main'),
65+ ('cloud:precise-havana/updates', url + ' precise-updates/havana main'),
66 ]
67
68
69@@ -314,16 +322,17 @@
70 _subp.assert_called_with(cmd)
71
72 @patch('__builtin__.open')
73- @patch('charmhelpers.contrib.openstack.utils.import_key')
74+ @patch('charmhelpers.contrib.openstack.utils.apt_install')
75 @patch('charmhelpers.contrib.openstack.utils.lsb_release')
76- def test_configure_install_source_uca_repos(self, _lsb, _import, _open):
77+ def test_configure_install_source_uca_repos(self, _lsb, _install, _open):
78 '''Test configuring installation source from UCA sources'''
79 _lsb.return_value = FAKE_RELEASE
80 _file = MagicMock(spec=file)
81 _open.return_value = _file
82 for src, url in UCA_SOURCES:
83 openstack.configure_installation_source(src)
84- _import.assert_called_with(openstack.CLOUD_ARCHIVE_KEY_ID)
85+ _install.assert_called_with('ubuntu-cloud-keyring',
86+ fatal=True)
87 _open.assert_called_with(
88 '/etc/apt/sources.list.d/cloud-archive.list',
89 'w'

Subscribers

People subscribed via source and target branches