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
1=== added symlink 'hooks/backup-backend-relation-broken'
2=== target is u'cinder_hooks.py'
3=== added symlink 'hooks/backup-backend-relation-changed'
4=== target is u'cinder_hooks.py'
5=== added symlink 'hooks/backup-backend-relation-departed'
6=== target is u'cinder_hooks.py'
7=== added symlink 'hooks/backup-backend-relation-joined'
8=== target is u'cinder_hooks.py'
9=== modified file 'hooks/cinder_hooks.py'
10--- hooks/cinder_hooks.py 2015-09-29 15:30:32 +0000
11+++ hooks/cinder_hooks.py 2015-10-01 13:39:08 +0000
12@@ -163,6 +163,10 @@
13 for rid in relation_ids('storage-backend'):
14 relation_set(relation_id=rid,
15 upgrade_nonce=uuid.uuid4())
16+ # NOTE(hopem) tell any backup-backends we just upgraded
17+ for rid in relation_ids('backup-backend'):
18+ relation_set(relation_id=rid,
19+ upgrade_nonce=uuid.uuid4())
20
21 # overwrite config is not in conf file. so We can't use restart_on_change
22 if config_value_changed('overwrite'):
23@@ -561,6 +565,13 @@
24 CONFIGS.write(CINDER_CONF)
25
26
27+@hooks.hook('backup-backend-relation-changed')
28+@hooks.hook('backup-backend-relation-broken')
29+@restart_on_change(restart_map())
30+def backup_backend():
31+ CONFIGS.write(CINDER_CONF)
32+
33+
34 @hooks.hook('nrpe-external-master-relation-joined',
35 'nrpe-external-master-relation-changed')
36 def update_nrpe_config():
37
38=== modified file 'hooks/cinder_utils.py'
39--- hooks/cinder_utils.py 2015-09-29 15:52:10 +0000
40+++ hooks/cinder_utils.py 2015-10-01 13:39:08 +0000
41@@ -185,7 +185,7 @@
42 cinder_contexts.HAProxyContext(),
43 cinder_contexts.ImageServiceContext(),
44 cinder_contexts.CinderSubordinateConfigContext(
45- interface='storage-backend',
46+ interface=['storage-backend', 'backup-backend'],
47 service='cinder',
48 config_file=CINDER_CONF),
49 cinder_contexts.StorageBackendContext(),
50@@ -195,7 +195,7 @@
51 service_user='cinder'),
52 context.BindHostContext(),
53 context.WorkerConfigContext()],
54- 'services': ['cinder-api', 'cinder-volume',
55+ 'services': ['cinder-api', 'cinder-volume', 'cinder-backup',
56 'cinder-scheduler', 'haproxy']
57 }),
58 (CINDER_API_CONF, {
59@@ -204,7 +204,7 @@
60 }),
61 (ceph_config_file(), {
62 'hook_contexts': [context.CephContext()],
63- 'services': ['cinder-volume']
64+ 'services': ['cinder-volume', 'cinder-backup']
65 }),
66 (HAPROXY_CONF, {
67 'hook_contexts': [context.HAProxyContext(singlenode_mode=True),
68
69=== modified file 'metadata.yaml'
70--- metadata.yaml 2015-07-01 14:47:56 +0000
71+++ metadata.yaml 2015-10-01 13:39:08 +0000
72@@ -32,6 +32,9 @@
73 storage-backend:
74 interface: cinder-backend
75 scope: container
76+ backup-backend:
77+ interface: cinder-backup
78+ scope: container
79 peers:
80 cluster:
81 interface: cinder-ha
82
83=== modified file 'templates/parts/backends'
84--- templates/parts/backends 2014-04-02 07:58:11 +0000
85+++ templates/parts/backends 2015-10-01 13:39:08 +0000
86@@ -1,18 +1,18 @@
87 {% if sections and 'DEFAULT' in sections -%}
88 {% for key, value in sections['DEFAULT'] -%}
89 {{ key }} = {{ value }}
90-{% endfor -%}
91-{% endif -%}
92+{% endfor %}
93+{%- endif %}
94
95 {% if backends -%}
96 enabled_backends = {{ backends }}
97-{% endif -%}
98+{%- endif %}
99
100 {% for section in sections -%}
101 {% if section != 'DEFAULT' -%}
102 [{{ section }}]
103 {% for key, value in sections[section] -%}
104 {{ key }} = {{ value }}
105-{% endfor -%}
106-{% endif -%}
107-{% endfor -%}
108\ No newline at end of file
109+{% endfor %}
110+{% endif %}
111+{%- endfor %}
112\ No newline at end of file
113
114=== modified file 'unit_tests/test_cinder_utils.py'
115--- unit_tests/test_cinder_utils.py 2015-08-03 09:22:32 +0000
116+++ unit_tests/test_cinder_utils.py 2015-10-01 13:39:08 +0000
117@@ -151,16 +151,18 @@
118
119 def test_services(self):
120 self.assertEquals(cinder_utils.services(),
121- ['haproxy', 'apache2', 'cinder-api',
122- 'cinder-volume', 'cinder-scheduler'])
123+ ['haproxy', 'cinder-backup', 'cinder-api',
124+ 'cinder-volume', 'apache2', 'cinder-scheduler'])
125
126 def test_creates_restart_map_all_enabled(self):
127 'It creates correct restart map when all services enabled'
128 ex_map = OrderedDict([
129 ('/etc/cinder/cinder.conf', ['cinder-api', 'cinder-volume',
130- 'cinder-scheduler', 'haproxy']),
131+ 'cinder-backup', 'cinder-scheduler',
132+ 'haproxy']),
133 ('/etc/cinder/api-paste.ini', ['cinder-api']),
134- ('/var/lib/charm/cinder/ceph.conf', ['cinder-volume']),
135+ ('/var/lib/charm/cinder/ceph.conf', ['cinder-volume',
136+ 'cinder-backup']),
137 ('/etc/haproxy/haproxy.cfg', ['haproxy']),
138 ('/etc/apache2/sites-available/openstack_https_frontend',
139 ['apache2']),
140@@ -723,8 +725,8 @@
141 ]
142 self.assertEquals(render.call_args_list, expected)
143 expected = [
144- call('tgtd'), call('haproxy'), call('apache2'),
145- call('cinder-api'), call('cinder-volume'),
146+ call('tgtd'), call('haproxy'), call('cinder-backup'),
147+ call('cinder-api'), call('cinder-volume'), call('apache2'),
148 call('cinder-scheduler'),
149 ]
150 self.assertEquals(service_restart.call_args_list, expected)

Subscribers

People subscribed via source and target branches