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
1=== modified file 'hooks/nova_cc_hooks.py'
2--- hooks/nova_cc_hooks.py 2015-04-20 10:21:36 +0000
3+++ hooks/nova_cc_hooks.py 2015-04-21 15:32:15 +0000
4@@ -295,17 +295,18 @@
5 # acl entry has been added. So, if the db supports passing a list of
6 # permitted units then check if we're in the list.
7 allowed_units = relation_get('nova_allowed_units')
8- if allowed_units and local_unit() not in allowed_units.split():
9- log('Allowed_units list provided and this unit not present')
10- return
11- migrate_nova_database()
12- log('Triggering remote cloud-compute restarts.')
13- [compute_joined(rid=rid, remote_restart=True)
14- for rid in relation_ids('cloud-compute')]
15- log('Triggering remote cell restarts.')
16- [nova_cell_relation_joined(rid=rid, remote_restart=True)
17- for rid in relation_ids('cell')]
18- conditional_neutron_migration()
19+ if allowed_units and local_unit() in allowed_units.split():
20+ migrate_nova_database()
21+ log('Triggering remote cloud-compute restarts.')
22+ [compute_joined(rid=rid, remote_restart=True)
23+ for rid in relation_ids('cloud-compute')]
24+ log('Triggering remote cell restarts.')
25+ [nova_cell_relation_joined(rid=rid, remote_restart=True)
26+ for rid in relation_ids('cell')]
27+ conditional_neutron_migration()
28+ else:
29+ log('allowed_units either not presented, or local unit '
30+ 'not in acl list: %s' % repr(allowed_units))
31
32
33 @hooks.hook('pgsql-nova-db-relation-changed')
34
35=== modified file 'unit_tests/test_nova_cc_hooks.py'
36--- unit_tests/test_nova_cc_hooks.py 2015-04-20 10:21:36 +0000
37+++ unit_tests/test_nova_cc_hooks.py 2015-04-21 15:32:15 +0000
38@@ -348,10 +348,11 @@
39 @patch.object(hooks, 'conditional_neutron_migration')
40 @patch.object(hooks, 'CONFIGS')
41 def test_db_changed(self, configs, cond_neutron_mig):
42+ 'No database migration is attempted when ACL list is not present'
43 self._shared_db_test(configs)
44 self.assertTrue(configs.write_all.called)
45- self.migrate_nova_database.assert_called_with()
46- cond_neutron_mig.assert_called_with()
47+ self.assertFalse(self.migrate_nova_database.called)
48+ self.assertFalse(cond_neutron_mig.called)
49
50 @patch.object(hooks, 'CONFIGS')
51 def test_db_changed_allowed(self, configs):

Subscribers

People subscribed via source and target branches