Merge lp:~hopem/charms/trusty/cinder/add-backup-support into lp:~openstack-charmers-archive/charms/trusty/cinder/next

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: 133
Proposed branch: lp:~hopem/charms/trusty/cinder/add-backup-support
Merge into: lp:~openstack-charmers-archive/charms/trusty/cinder/next
Diff against target: 150 lines (+31/-15)
5 files modified
hooks/cinder_hooks.py (+11/-0)
hooks/cinder_utils.py (+3/-3)
metadata.yaml (+3/-0)
templates/parts/backends (+6/-6)
unit_tests/test_cinder_utils.py (+8/-6)
To merge this branch: bzr merge lp:~hopem/charms/trusty/cinder/add-backup-support
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+261243@code.launchpad.net
To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #11152 cinder-next for hopem mp261243
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/11152/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #6933 cinder-next for hopem mp261243
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/6933/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #7028 cinder-next for hopem mp261243
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [functional_test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/12644797/
Build: http://10.245.162.77:8080/job/charm_amulet_test/7028/

Revision history for this message
Liam Young (gnuoy) wrote :

Approve

review: Approve
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #11533 cinder-next for hopem mp261243
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/11533/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #10727 cinder-next for hopem mp261243
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/10727/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #7240 cinder-next for hopem mp261243
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/7240/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added symlink 'hooks/backup-backend-relation-broken'
=== target is u'cinder_hooks.py'
=== added symlink 'hooks/backup-backend-relation-changed'
=== target is u'cinder_hooks.py'
=== added symlink 'hooks/backup-backend-relation-departed'
=== target is u'cinder_hooks.py'
=== added symlink 'hooks/backup-backend-relation-joined'
=== target is u'cinder_hooks.py'
=== modified file 'hooks/cinder_hooks.py'
--- hooks/cinder_hooks.py 2015-09-29 15:30:32 +0000
+++ hooks/cinder_hooks.py 2015-10-01 13:39:08 +0000
@@ -163,6 +163,10 @@
163 for rid in relation_ids('storage-backend'):163 for rid in relation_ids('storage-backend'):
164 relation_set(relation_id=rid,164 relation_set(relation_id=rid,
165 upgrade_nonce=uuid.uuid4())165 upgrade_nonce=uuid.uuid4())
166 # NOTE(hopem) tell any backup-backends we just upgraded
167 for rid in relation_ids('backup-backend'):
168 relation_set(relation_id=rid,
169 upgrade_nonce=uuid.uuid4())
166170
167 # overwrite config is not in conf file. so We can't use restart_on_change171 # overwrite config is not in conf file. so We can't use restart_on_change
168 if config_value_changed('overwrite'):172 if config_value_changed('overwrite'):
@@ -561,6 +565,13 @@
561 CONFIGS.write(CINDER_CONF)565 CONFIGS.write(CINDER_CONF)
562566
563567
568@hooks.hook('backup-backend-relation-changed')
569@hooks.hook('backup-backend-relation-broken')
570@restart_on_change(restart_map())
571def backup_backend():
572 CONFIGS.write(CINDER_CONF)
573
574
564@hooks.hook('nrpe-external-master-relation-joined',575@hooks.hook('nrpe-external-master-relation-joined',
565 'nrpe-external-master-relation-changed')576 'nrpe-external-master-relation-changed')
566def update_nrpe_config():577def update_nrpe_config():
567578
=== modified file 'hooks/cinder_utils.py'
--- hooks/cinder_utils.py 2015-09-29 15:52:10 +0000
+++ hooks/cinder_utils.py 2015-10-01 13:39:08 +0000
@@ -185,7 +185,7 @@
185 cinder_contexts.HAProxyContext(),185 cinder_contexts.HAProxyContext(),
186 cinder_contexts.ImageServiceContext(),186 cinder_contexts.ImageServiceContext(),
187 cinder_contexts.CinderSubordinateConfigContext(187 cinder_contexts.CinderSubordinateConfigContext(
188 interface='storage-backend',188 interface=['storage-backend', 'backup-backend'],
189 service='cinder',189 service='cinder',
190 config_file=CINDER_CONF),190 config_file=CINDER_CONF),
191 cinder_contexts.StorageBackendContext(),191 cinder_contexts.StorageBackendContext(),
@@ -195,7 +195,7 @@
195 service_user='cinder'),195 service_user='cinder'),
196 context.BindHostContext(),196 context.BindHostContext(),
197 context.WorkerConfigContext()],197 context.WorkerConfigContext()],
198 'services': ['cinder-api', 'cinder-volume',198 'services': ['cinder-api', 'cinder-volume', 'cinder-backup',
199 'cinder-scheduler', 'haproxy']199 'cinder-scheduler', 'haproxy']
200 }),200 }),
201 (CINDER_API_CONF, {201 (CINDER_API_CONF, {
@@ -204,7 +204,7 @@
204 }),204 }),
205 (ceph_config_file(), {205 (ceph_config_file(), {
206 'hook_contexts': [context.CephContext()],206 'hook_contexts': [context.CephContext()],
207 'services': ['cinder-volume']207 'services': ['cinder-volume', 'cinder-backup']
208 }),208 }),
209 (HAPROXY_CONF, {209 (HAPROXY_CONF, {
210 'hook_contexts': [context.HAProxyContext(singlenode_mode=True),210 'hook_contexts': [context.HAProxyContext(singlenode_mode=True),
211211
=== modified file 'metadata.yaml'
--- metadata.yaml 2015-07-01 14:47:56 +0000
+++ metadata.yaml 2015-10-01 13:39:08 +0000
@@ -32,6 +32,9 @@
32 storage-backend:32 storage-backend:
33 interface: cinder-backend33 interface: cinder-backend
34 scope: container34 scope: container
35 backup-backend:
36 interface: cinder-backup
37 scope: container
35peers:38peers:
36 cluster:39 cluster:
37 interface: cinder-ha40 interface: cinder-ha
3841
=== modified file 'templates/parts/backends'
--- templates/parts/backends 2014-04-02 07:58:11 +0000
+++ templates/parts/backends 2015-10-01 13:39:08 +0000
@@ -1,18 +1,18 @@
1{% if sections and 'DEFAULT' in sections -%}1{% if sections and 'DEFAULT' in sections -%}
2{% for key, value in sections['DEFAULT'] -%}2{% for key, value in sections['DEFAULT'] -%}
3{{ key }} = {{ value }}3{{ key }} = {{ value }}
4{% endfor -%}4{% endfor %}
5{% endif -%}5{%- endif %}
66
7{% if backends -%}7{% if backends -%}
8enabled_backends = {{ backends }}8enabled_backends = {{ backends }}
9{% endif -%}9{%- endif %}
1010
11{% for section in sections -%}11{% for section in sections -%}
12{% if section != 'DEFAULT' -%}12{% if section != 'DEFAULT' -%}
13[{{ section }}]13[{{ section }}]
14{% for key, value in sections[section] -%}14{% for key, value in sections[section] -%}
15{{ key }} = {{ value }}15{{ key }} = {{ value }}
16{% endfor -%}
17{% endif -%}
18{% endfor -%}
19\ No newline at end of file16\ No newline at end of file
17{% endfor %}
18{% endif %}
19{%- endfor %}
20\ No newline at end of file20\ No newline at end of file
2121
=== modified file 'unit_tests/test_cinder_utils.py'
--- unit_tests/test_cinder_utils.py 2015-08-03 09:22:32 +0000
+++ unit_tests/test_cinder_utils.py 2015-10-01 13:39:08 +0000
@@ -151,16 +151,18 @@
151151
152 def test_services(self):152 def test_services(self):
153 self.assertEquals(cinder_utils.services(),153 self.assertEquals(cinder_utils.services(),
154 ['haproxy', 'apache2', 'cinder-api',154 ['haproxy', 'cinder-backup', 'cinder-api',
155 'cinder-volume', 'cinder-scheduler'])155 'cinder-volume', 'apache2', 'cinder-scheduler'])
156156
157 def test_creates_restart_map_all_enabled(self):157 def test_creates_restart_map_all_enabled(self):
158 'It creates correct restart map when all services enabled'158 'It creates correct restart map when all services enabled'
159 ex_map = OrderedDict([159 ex_map = OrderedDict([
160 ('/etc/cinder/cinder.conf', ['cinder-api', 'cinder-volume',160 ('/etc/cinder/cinder.conf', ['cinder-api', 'cinder-volume',
161 'cinder-scheduler', 'haproxy']),161 'cinder-backup', 'cinder-scheduler',
162 'haproxy']),
162 ('/etc/cinder/api-paste.ini', ['cinder-api']),163 ('/etc/cinder/api-paste.ini', ['cinder-api']),
163 ('/var/lib/charm/cinder/ceph.conf', ['cinder-volume']),164 ('/var/lib/charm/cinder/ceph.conf', ['cinder-volume',
165 'cinder-backup']),
164 ('/etc/haproxy/haproxy.cfg', ['haproxy']),166 ('/etc/haproxy/haproxy.cfg', ['haproxy']),
165 ('/etc/apache2/sites-available/openstack_https_frontend',167 ('/etc/apache2/sites-available/openstack_https_frontend',
166 ['apache2']),168 ['apache2']),
@@ -723,8 +725,8 @@
723 ]725 ]
724 self.assertEquals(render.call_args_list, expected)726 self.assertEquals(render.call_args_list, expected)
725 expected = [727 expected = [
726 call('tgtd'), call('haproxy'), call('apache2'),728 call('tgtd'), call('haproxy'), call('cinder-backup'),
727 call('cinder-api'), call('cinder-volume'),729 call('cinder-api'), call('cinder-volume'), call('apache2'),
728 call('cinder-scheduler'),730 call('cinder-scheduler'),
729 ]731 ]
730 self.assertEquals(service_restart.call_args_list, expected)732 self.assertEquals(service_restart.call_args_list, expected)

Subscribers

People subscribed via source and target branches