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
=== modified file 'charmhelpers/contrib/openstack/utils.py'
--- charmhelpers/contrib/openstack/utils.py 2013-07-12 08:18:11 +0000
+++ charmhelpers/contrib/openstack/utils.py 2013-07-12 08:54:32 +0000
@@ -16,6 +16,7 @@
1616
17from charmhelpers.core.host import (17from charmhelpers.core.host import (
18 lsb_release,18 lsb_release,
19 apt_install
19)20)
2021
21CLOUD_ARCHIVE_URL = "http://ubuntu-cloud.archive.canonical.com/ubuntu"22CLOUD_ARCHIVE_URL = "http://ubuntu-cloud.archive.canonical.com/ubuntu"
@@ -47,6 +48,8 @@
47 '1.7.6': 'grizzly',48 '1.7.6': 'grizzly',
48 '1.7.7': 'grizzly',49 '1.7.7': 'grizzly',
49 '1.8.0': 'grizzly',50 '1.8.0': 'grizzly',
51 '1.9.0': 'havana',
52 '1.9.1': 'havana',
50}53}
5154
5255
@@ -211,7 +214,10 @@
211 'folsom/proposed': 'precise-proposed/folsom',214 'folsom/proposed': 'precise-proposed/folsom',
212 'grizzly': 'precise-updates/grizzly',215 'grizzly': 'precise-updates/grizzly',
213 'grizzly/updates': 'precise-updates/grizzly',216 'grizzly/updates': 'precise-updates/grizzly',
214 'grizzly/proposed': 'precise-proposed/grizzly'217 'grizzly/proposed': 'precise-proposed/grizzly',
218 'havana': 'precise-updates/havana',
219 'havana/updates': 'precise-updates/havana',
220 'havana/proposed': 'precise-proposed/havana',
215 }221 }
216222
217 try:223 try:
@@ -221,8 +227,7 @@
221 error_out(e)227 error_out(e)
222228
223 src = "deb %s %s main" % (CLOUD_ARCHIVE_URL, pocket)229 src = "deb %s %s main" % (CLOUD_ARCHIVE_URL, pocket)
224 # TODO: Replace key import with cloud archive keyring pkg.230 apt_install('ubuntu-cloud-keyring', fatal=True)
225 import_key(CLOUD_ARCHIVE_KEY_ID)
226231
227 with open('/etc/apt/sources.list.d/cloud-archive.list', 'w') as f:232 with open('/etc/apt/sources.list.d/cloud-archive.list', 'w') as f:
228 f.write(src)233 f.write(src)
229234
=== modified file 'tests/contrib/openstack/test_openstack_utils.py'
--- tests/contrib/openstack/test_openstack_utils.py 2013-07-12 08:18:11 +0000
+++ tests/contrib/openstack/test_openstack_utils.py 2013-07-12 08:54:32 +0000
@@ -38,6 +38,11 @@
38 'os_release': 'grizzly',38 'os_release': 'grizzly',
39 'os_version': '1.7.7'39 'os_version': '1.7.7'
40 },40 },
41 'swift-proxy': {
42 'pkg_vers': '1.9.0-0ubuntu1',
43 'os_release': 'havana',
44 'os_version': '1.9.0'
45 },
41 # a package thats available in the cache but is not installed46 # a package thats available in the cache but is not installed
42 'cinder-common': {47 'cinder-common': {
43 'os_release': 'havana',48 'os_release': 'havana',
@@ -60,6 +65,9 @@
60 ('cloud:precise-grizzly/proposed', url + ' precise-proposed/grizzly main'),65 ('cloud:precise-grizzly/proposed', url + ' precise-proposed/grizzly main'),
61 ('cloud:precise-grizzly', url + ' precise-updates/grizzly main'),66 ('cloud:precise-grizzly', url + ' precise-updates/grizzly main'),
62 ('cloud:precise-grizzly/updates', url + ' precise-updates/grizzly main'),67 ('cloud:precise-grizzly/updates', url + ' precise-updates/grizzly main'),
68 ('cloud:precise-havana/proposed', url + ' precise-proposed/havana main'),
69 ('cloud:precise-havana', url + ' precise-updates/havana main'),
70 ('cloud:precise-havana/updates', url + ' precise-updates/havana main'),
63]71]
6472
6573
@@ -314,16 +322,17 @@
314 _subp.assert_called_with(cmd)322 _subp.assert_called_with(cmd)
315323
316 @patch('__builtin__.open')324 @patch('__builtin__.open')
317 @patch('charmhelpers.contrib.openstack.utils.import_key')325 @patch('charmhelpers.contrib.openstack.utils.apt_install')
318 @patch('charmhelpers.contrib.openstack.utils.lsb_release')326 @patch('charmhelpers.contrib.openstack.utils.lsb_release')
319 def test_configure_install_source_uca_repos(self, _lsb, _import, _open):327 def test_configure_install_source_uca_repos(self, _lsb, _install, _open):
320 '''Test configuring installation source from UCA sources'''328 '''Test configuring installation source from UCA sources'''
321 _lsb.return_value = FAKE_RELEASE329 _lsb.return_value = FAKE_RELEASE
322 _file = MagicMock(spec=file)330 _file = MagicMock(spec=file)
323 _open.return_value = _file331 _open.return_value = _file
324 for src, url in UCA_SOURCES:332 for src, url in UCA_SOURCES:
325 openstack.configure_installation_source(src)333 openstack.configure_installation_source(src)
326 _import.assert_called_with(openstack.CLOUD_ARCHIVE_KEY_ID)334 _install.assert_called_with('ubuntu-cloud-keyring',
335 fatal=True)
327 _open.assert_called_with(336 _open.assert_called_with(
328 '/etc/apt/sources.list.d/cloud-archive.list',337 '/etc/apt/sources.list.d/cloud-archive.list',
329 'w'338 'w'

Subscribers

People subscribed via source and target branches