Merge lp:~james-page/charms/quantal/ceph-radosgw/trunk into lp:~charmers/charms/quantal/ceph-radosgw/trunk

Proposed by James Page
Status: Merged
Merge reported by: Juan L. Negron
Merged at revision: not available
Proposed branch: lp:~james-page/charms/quantal/ceph-radosgw/trunk
Merge into: lp:~charmers/charms/quantal/ceph-radosgw/trunk
Diff against target: 65 lines (+25/-11)
2 files modified
config.yaml (+1/-1)
hooks/utils.py (+24/-10)
To merge this branch: bzr merge lp:~james-page/charms/quantal/ceph-radosgw/trunk
Reviewer Review Type Date Requested Status
Juan L. Negron (community) Approve
Review via email: mp+133888@code.launchpad.net

Description of the change

Support use of cloud: prefix to pull ceph from the Ubuntu cloud archive.

To post a comment you must log in.
Revision history for this message
Juan L. Negron (negronjl) wrote :

Reviewing this now.

-Juan

Revision history for this message
Juan L. Negron (negronjl) wrote :

Ahh ... missed the fact that this is a quantal charm...

It'll be a minute or two longer while I set up my environment for this.

-Juan

Revision history for this message
Juan L. Negron (negronjl) wrote :

This looks good to me.

Approved.

I'll merge it in a few minutes.

-Juan

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2012-10-09 15:14:23 +0000
3+++ config.yaml 2012-11-12 10:11:22 +0000
4@@ -5,7 +5,7 @@
5 Optional configuration to support use of additional sources such as:
6 .
7 - ppa:myteam/ppa
8- - cloud:folsom-proposed
9+ - cloud:precise-proposed/folsom
10 - http://my.archive.com/ubuntu main
11 .
12 The last option should be used in conjunction with the key configuration
13
14=== modified file 'hooks/utils.py'
15--- hooks/utils.py 2012-10-08 15:58:16 +0000
16+++ hooks/utils.py 2012-11-12 10:11:22 +0000
17@@ -51,24 +51,38 @@
18 return template.render(context)
19
20
21+CLOUD_ARCHIVE = \
22+""" # Ubuntu Cloud Archive
23+deb http://ubuntu-cloud.archive.canonical.com/ubuntu {} main
24+"""
25+
26+
27 def configure_source():
28- source = config_get('source')
29- if (source.startswith('ppa:') or
30- source.startswith('cloud:') or
31- source.startswith('http:')):
32+ source = str(config_get('source'))
33+ if not source:
34+ return
35+ if source.startswith('ppa:'):
36 cmd = [
37 'add-apt-repository',
38 source
39 ]
40 subprocess.check_call(cmd)
41+ if source.startswith('cloud:'):
42+ install('ubuntu-cloud-keyring')
43+ pocket = source.split(':')[1]
44+ with open('/etc/apt/sources.list.d/cloud-archive.list', 'w') as apt:
45+ apt.write(CLOUD_ARCHIVE.format(pocket))
46 if source.startswith('http:'):
47+ with open('/etc/apt/sources.list.d/quantum.list', 'w') as apt:
48+ apt.write("deb " + source + "\n")
49 key = config_get('key')
50- cmd = [
51- 'apt-key',
52- 'import',
53- key
54- ]
55- subprocess.check_call(cmd)
56+ if key:
57+ cmd = [
58+ 'apt-key',
59+ 'adv', '--keyserver keyserver.ubuntu.com',
60+ '--recv-keys', key
61+ ]
62+ subprocess.check_call(cmd)
63 cmd = [
64 'apt-get',
65 'update'

Subscribers

People subscribed via source and target branches

to all changes: