Merge lp:~gnuoy/charms/trusty/nova-cloud-controller/restict-neutron-db-migrations into lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next

Proposed by Liam Young
Status: Merged
Merged at revision: 104
Proposed branch: lp:~gnuoy/charms/trusty/nova-cloud-controller/restict-neutron-db-migrations
Merge into: lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next
Diff against target: 55 lines (+18/-3)
2 files modified
hooks/nova_cc_hooks.py (+4/-0)
unit_tests/test_nova_cc_hooks.py (+14/-3)
To merge this branch: bzr merge lp:~gnuoy/charms/trusty/nova-cloud-controller/restict-neutron-db-migrations
Reviewer Review Type Date Requested Status
James Page Approve
Review via email: mp+236670@code.launchpad.net
To post a comment you must log in.
Revision history for this message
James Page (james-page) :
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 2014-09-29 13:58:29 +0000
+++ hooks/nova_cc_hooks.py 2014-10-01 08:33:10 +0000
@@ -40,6 +40,7 @@
40from charmhelpers.contrib.openstack.utils import (40from charmhelpers.contrib.openstack.utils import (
41 configure_installation_source,41 configure_installation_source,
42 openstack_upgrade_available,42 openstack_upgrade_available,
43 os_release,
43)44)
4445
45from charmhelpers.contrib.openstack.neutron import (46from charmhelpers.contrib.openstack.neutron import (
@@ -179,6 +180,9 @@
179 if relation_ids('neutron-api'):180 if relation_ids('neutron-api'):
180 log('Not running neutron database migration as neutron-api service'181 log('Not running neutron database migration as neutron-api service'
181 'is present.')182 'is present.')
183 elif os_release('nova-common') <= 'icehouse':
184 log('Not running neutron database migration as migrations are handled'
185 'by the neutron-server process.')
182 else:186 else:
183 migrate_neutron_database()187 migrate_neutron_database()
184 # neutron-api service may have appeared while the migration was188 # neutron-api service may have appeared while the migration was
185189
=== modified file 'unit_tests/test_nova_cc_hooks.py'
--- unit_tests/test_nova_cc_hooks.py 2014-09-29 13:58:29 +0000
+++ unit_tests/test_nova_cc_hooks.py 2014-10-01 08:33:10 +0000
@@ -39,6 +39,7 @@
39 'is_relation_made',39 'is_relation_made',
40 'local_unit',40 'local_unit',
41 'log',41 'log',
42 'os_release',
42 'relation_get',43 'relation_get',
43 'relation_set',44 'relation_set',
44 'relation_ids',45 'relation_ids',
@@ -508,8 +509,18 @@
508 )509 )
509510
510 def test_conditional_neutron_migration_noapi_rel(self):511 def test_conditional_neutron_migration_noapi_rel(self):
512 self.os_release.return_value = 'juno'
511 self.relation_ids.return_value = []513 self.relation_ids.return_value = []
512 hooks.conditional_neutron_migration()
513 self.services.return_value = ['neutron-server']514 self.services.return_value = ['neutron-server']
514 self.migrate_neutron_database.assert_called()515 hooks.conditional_neutron_migration()
515 self.service_restart.assert_called()516 self.migrate_neutron_database.assert_called_with()
517 self.service_restart.assert_called_with('neutron-server')
518
519 def test_conditional_neutron_migration_noapi_rel_juno(self):
520 self.os_release.return_value = 'icehouse'
521 self.relation_ids.return_value = []
522 hooks.conditional_neutron_migration()
523 self.log.assert_called_with(
524 'Not running neutron database migration as migrations are handled'
525 'by the neutron-server process.'
526 )

Subscribers

People subscribed via source and target branches