Merge lp:~james-page/charms/trusty/nova-cloud-controller/fixup-allowedunits-migration into lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next

Proposed by James Page
Status: Merged
Merged at revision: 160
Proposed branch: lp:~james-page/charms/trusty/nova-cloud-controller/fixup-allowedunits-migration
Merge into: lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next
Diff against target: 51 lines (+15/-13)
2 files modified
hooks/nova_cc_hooks.py (+12/-11)
unit_tests/test_nova_cc_hooks.py (+3/-2)
To merge this branch: bzr merge lp:~james-page/charms/trusty/nova-cloud-controller/fixup-allowedunits-migration
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Adam Collard (community) Approve
Review via email: mp+256959@code.launchpad.net
To post a comment you must log in.
161. By James Page

Drop errant log message

Revision history for this message
Adam Collard (adam-collard) :
review: Approve
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #3689 nova-cloud-controller-next for james-page mp256959
    LINT OK: passed

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

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

charm_unit_test #3476 nova-cloud-controller-next for james-page mp256959
    UNIT OK: passed

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

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

charm_amulet_test #3484 nova-cloud-controller-next for james-page mp256959
    AMULET FAIL: amulet-test failed

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

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

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

Approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/nova_cc_hooks.py'
--- hooks/nova_cc_hooks.py 2015-04-20 10:21:36 +0000
+++ hooks/nova_cc_hooks.py 2015-04-21 15:32:15 +0000
@@ -295,17 +295,18 @@
295 # acl entry has been added. So, if the db supports passing a list of295 # acl entry has been added. So, if the db supports passing a list of
296 # permitted units then check if we're in the list.296 # permitted units then check if we're in the list.
297 allowed_units = relation_get('nova_allowed_units')297 allowed_units = relation_get('nova_allowed_units')
298 if allowed_units and local_unit() not in allowed_units.split():298 if allowed_units and local_unit() in allowed_units.split():
299 log('Allowed_units list provided and this unit not present')299 migrate_nova_database()
300 return300 log('Triggering remote cloud-compute restarts.')
301 migrate_nova_database()301 [compute_joined(rid=rid, remote_restart=True)
302 log('Triggering remote cloud-compute restarts.')302 for rid in relation_ids('cloud-compute')]
303 [compute_joined(rid=rid, remote_restart=True)303 log('Triggering remote cell restarts.')
304 for rid in relation_ids('cloud-compute')]304 [nova_cell_relation_joined(rid=rid, remote_restart=True)
305 log('Triggering remote cell restarts.')305 for rid in relation_ids('cell')]
306 [nova_cell_relation_joined(rid=rid, remote_restart=True)306 conditional_neutron_migration()
307 for rid in relation_ids('cell')]307 else:
308 conditional_neutron_migration()308 log('allowed_units either not presented, or local unit '
309 'not in acl list: %s' % repr(allowed_units))
309310
310311
311@hooks.hook('pgsql-nova-db-relation-changed')312@hooks.hook('pgsql-nova-db-relation-changed')
312313
=== modified file 'unit_tests/test_nova_cc_hooks.py'
--- unit_tests/test_nova_cc_hooks.py 2015-04-20 10:21:36 +0000
+++ unit_tests/test_nova_cc_hooks.py 2015-04-21 15:32:15 +0000
@@ -348,10 +348,11 @@
348 @patch.object(hooks, 'conditional_neutron_migration')348 @patch.object(hooks, 'conditional_neutron_migration')
349 @patch.object(hooks, 'CONFIGS')349 @patch.object(hooks, 'CONFIGS')
350 def test_db_changed(self, configs, cond_neutron_mig):350 def test_db_changed(self, configs, cond_neutron_mig):
351 'No database migration is attempted when ACL list is not present'
351 self._shared_db_test(configs)352 self._shared_db_test(configs)
352 self.assertTrue(configs.write_all.called)353 self.assertTrue(configs.write_all.called)
353 self.migrate_nova_database.assert_called_with()354 self.assertFalse(self.migrate_nova_database.called)
354 cond_neutron_mig.assert_called_with()355 self.assertFalse(cond_neutron_mig.called)
355356
356 @patch.object(hooks, 'CONFIGS')357 @patch.object(hooks, 'CONFIGS')
357 def test_db_changed_allowed(self, configs):358 def test_db_changed_allowed(self, configs):

Subscribers

People subscribed via source and target branches