Merge lp:~hopem/charms/precise/glance/python-redux.lp1227008 into lp:~openstack-charmers/charms/precise/glance/python-redux

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: 216
Proposed branch: lp:~hopem/charms/precise/glance/python-redux.lp1227008
Merge into: lp:~openstack-charmers/charms/precise/glance/python-redux
Diff against target: 85 lines (+21/-6)
5 files modified
config.yaml (+10/-0)
hooks/glance_relations.py (+6/-2)
hooks/glance_utils.py (+2/-2)
revision (+1/-1)
unit_tests/test_glance_relations.py (+2/-1)
To merge this branch: bzr merge lp:~hopem/charms/precise/glance/python-redux.lp1227008
Reviewer Review Type Date Requested Status
OpenStack Charmers Pending
Review via email: mp+187286@code.launchpad.net
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 'config.yaml'
2--- config.yaml 2013-06-20 18:26:12 +0000
3+++ config.yaml 2013-09-24 17:11:29 +0000
4@@ -26,6 +26,16 @@
5 default: RegionOne
6 type: string
7 description: OpenStack Region
8+ ceph-osd-replication-count:
9+ default: 2
10+ type: int
11+ description: |
12+ This value dictates the number of replicas ceph must make of any
13+ object it stores within the images rbd pool. Of course, this only
14+ applies if using Ceph as a backend store. Note that once the images
15+ rbd pool has been created, changing this value will not have any
16+ effect (although it can be changed in ceph by manually configuring
17+ your ceph cluster).
18 # HA configuration settings
19 vip:
20 type: string
21
22=== modified file 'hooks/glance_relations.py'
23--- hooks/glance_relations.py 2013-09-24 16:00:52 +0000
24+++ hooks/glance_relations.py 2013-09-24 17:11:29 +0000
25@@ -150,7 +150,9 @@
26 juju_log('ceph relation incomplete. Peer not ready?')
27 return
28
29- if not ensure_ceph_keyring(service=service_name(),
30+ service = service_name()
31+
32+ if not ensure_ceph_keyring(service=service,
33 user='glance', group='glance'):
34 juju_log('Could not create ceph keyring: peer not ready?')
35 return
36@@ -159,7 +161,9 @@
37 CONFIGS.write(CEPH_CONF)
38
39 if eligible_leader(CLUSTER_RES):
40- ensure_ceph_pool(service=service_name())
41+ _config = config()
42+ ensure_ceph_pool(service=service,
43+ replicas=_config['ceph-osd-replication-count'])
44
45
46 @hooks.hook('identity-service-relation-joined')
47
48=== modified file 'hooks/glance_utils.py'
49--- hooks/glance_utils.py 2013-09-23 18:46:48 +0000
50+++ hooks/glance_utils.py 2013-09-24 17:11:29 +0000
51@@ -126,11 +126,11 @@
52 subprocess.check_call(cmd)
53
54
55-def ensure_ceph_pool(service):
56+def ensure_ceph_pool(service, replicas):
57 '''Creates a ceph pool for service if one does not exist'''
58 # TODO: Ditto about moving somewhere sharable.
59 if not ceph_pool_exists(service=service, name=service):
60- ceph_create_pool(service=service, name=service)
61+ ceph_create_pool(service=service, name=service, replicas=replicas)
62
63
64 def do_openstack_upgrade(configs):
65
66=== modified file 'revision'
67--- revision 2013-08-16 21:22:59 +0000
68+++ revision 2013-09-24 17:11:29 +0000
69@@ -1,1 +1,1 @@
70-144
71+145
72
73=== modified file 'unit_tests/test_glance_relations.py'
74--- unit_tests/test_glance_relations.py 2013-09-20 15:52:45 +0000
75+++ unit_tests/test_glance_relations.py 2013-09-24 17:11:29 +0000
76@@ -222,7 +222,8 @@
77 self.assertEquals([call('/etc/glance/glance-api.conf'),
78 call('/etc/ceph/ceph.conf')],
79 configs.write.call_args_list)
80- self.ensure_ceph_pool.assert_called_with(service=self.service_name())
81+ self.ensure_ceph_pool.assert_called_with(service=self.service_name(),
82+ replicas=2)
83
84 def test_keystone_joined_not_leader(self):
85 self.eligible_leader.return_value = False

Subscribers

People subscribed via source and target branches