Merge lp:~gnuoy/charms/trusty/nova-cloud-controller/kilo-neutron-dbmig into lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next

Proposed by Liam Young
Status: Merged
Merged at revision: 161
Proposed branch: lp:~gnuoy/charms/trusty/nova-cloud-controller/kilo-neutron-dbmig
Merge into: lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next
Diff against target: 107 lines (+42/-8)
4 files modified
hooks/nova_cc_hooks.py (+4/-1)
hooks/nova_cc_utils.py (+3/-2)
unit_tests/test_nova_cc_hooks.py (+12/-5)
unit_tests/test_nova_cc_utils.py (+23/-0)
To merge this branch: bzr merge lp:~gnuoy/charms/trusty/nova-cloud-controller/kilo-neutron-dbmig
Reviewer Review Type Date Requested Status
OpenStack Charmers Pending
Review via email: mp+257224@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 #3854 nova-cloud-controller-next for gnuoy mp257224
    LINT OK: passed

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

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

charm_unit_test #3641 nova-cloud-controller-next for gnuoy mp257224
    UNIT OK: passed

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

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

charm_amulet_test #3642 nova-cloud-controller-next for gnuoy mp257224
    AMULET OK: passed

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

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-21 15:32:08 +0000
3+++ hooks/nova_cc_hooks.py 2015-04-23 07:24:11 +0000
4@@ -207,8 +207,11 @@
5
6 def conditional_neutron_migration():
7 if os_release('nova-common') <= 'icehouse':
8- log('Not running neutron database migration as migrations are handled'
9+ log('Not running neutron database migration as migrations are handled '
10 'by the neutron-server process.')
11+ elif os_release('nova-common') >= 'kilo':
12+ log('Not running neutron database migration as migrations are by '
13+ 'the neutron-api charm.')
14 else:
15 migrate_neutron_database()
16 # neutron-api service may have appeared while the migration was
17
18=== modified file 'hooks/nova_cc_utils.py'
19--- hooks/nova_cc_utils.py 2015-04-20 10:21:36 +0000
20+++ hooks/nova_cc_utils.py 2015-04-23 07:24:11 +0000
21@@ -530,11 +530,12 @@
22 configs.write_all()
23 neutron_db_manage(['upgrade', 'head'])
24 else:
25+ if new_os_rel < 'kilo':
26+ neutron_db_manage(['stamp', cur_os_rel])
27+ migrate_neutron_database()
28 # NOTE(jamespage) upgrade with existing config files as the
29 # havana->icehouse migration enables new service_plugins which
30 # create issues with db upgrades
31- neutron_db_manage(['stamp', cur_os_rel])
32- migrate_neutron_database()
33 reset_os_release()
34 configs = register_configs(release=new_os_rel)
35 configs.write_all()
36
37=== modified file 'unit_tests/test_nova_cc_hooks.py'
38--- unit_tests/test_nova_cc_hooks.py 2015-04-21 15:28:53 +0000
39+++ unit_tests/test_nova_cc_hooks.py 2015-04-23 07:24:11 +0000
40@@ -598,21 +598,28 @@
41 }
42 self.assertEqual(_con_sets, console_settings)
43
44- def test_conditional_neutron_migration_noapi_rel(self):
45+ def test_conditional_neutron_migration(self):
46 self.os_release.return_value = 'juno'
47- self.relation_ids.return_value = []
48 self.services.return_value = ['neutron-server']
49 hooks.conditional_neutron_migration()
50 self.migrate_neutron_database.assert_called_with()
51 self.service_restart.assert_called_with('neutron-server')
52
53- def test_conditional_neutron_migration_noapi_rel_juno(self):
54+ def test_conditional_neutron_migration_juno(self):
55 self.os_release.return_value = 'icehouse'
56- self.relation_ids.return_value = []
57 hooks.conditional_neutron_migration()
58 self.log.assert_called_with(
59 'Not running neutron database migration as migrations are handled'
60- 'by the neutron-server process.'
61+ ' by the neutron-server process.'
62+ )
63+
64+ def test_conditional_neutron_migration_kilo(self):
65+ self.os_release.return_value = 'kilo'
66+ self.relation_ids.return_value = []
67+ hooks.conditional_neutron_migration()
68+ self.log.assert_called_with(
69+ 'Not running neutron database migration as migrations are by the '
70+ 'neutron-api charm.'
71 )
72
73 def test_ha_relation_joined_no_bound_ip(self):
74
75=== modified file 'unit_tests/test_nova_cc_utils.py'
76--- unit_tests/test_nova_cc_utils.py 2015-04-20 10:21:36 +0000
77+++ unit_tests/test_nova_cc_utils.py 2015-04-23 07:24:11 +0000
78@@ -687,6 +687,29 @@
79 self.assertEquals(self.ml2_migration.call_count, 0)
80 self.assertTrue(migrate_nova_database.call_count, 1)
81
82+ @patch.object(utils, 'get_step_upgrade_source')
83+ @patch.object(utils, 'migrate_nova_database')
84+ @patch.object(utils, 'determine_packages')
85+ def test_upgrade_juno_kilo(self, determine_packages,
86+ migrate_nova_database,
87+ get_step_upgrade_source):
88+ "Simulate a call to do_openstack_upgrade() for juno->kilo"
89+ self.test_config.set('openstack-origin', 'cloud:trusty-kilo')
90+ get_step_upgrade_source.return_value = None
91+ self.os_release.return_value = 'juno'
92+ self.get_os_codename_install_source.return_value = 'kilo'
93+ self.eligible_leader.return_value = True
94+ self.relation_ids.return_value = []
95+ utils.do_openstack_upgrade()
96+ self.assertEquals(self.neutron_db_manage.call_count, 0)
97+ self.apt_update.assert_called_with(fatal=True)
98+ self.apt_upgrade.assert_called_with(options=DPKG_OPTS, fatal=True,
99+ dist=True)
100+ self.apt_install.assert_called_with(determine_packages(), fatal=True)
101+ self.register_configs.assert_called_with(release='kilo')
102+ self.assertEquals(self.ml2_migration.call_count, 0)
103+ self.assertTrue(migrate_nova_database.call_count, 1)
104+
105 @patch.object(utils, '_do_openstack_upgrade')
106 def test_upgrade_grizzly_icehouse_source(self, _do_openstack_upgrade):
107 "Verify get_step_upgrade_source() for grizzly->icehouse"

Subscribers

People subscribed via source and target branches