No db stamp for upgrade from Liberty

Stamping the Neutron db for Liberty fails and appears to be
unneccesary.

Change-Id: I93ff69db57bc3418a4c73e79e884f5c85d533f99
Closes-Bug: 1536675
This commit is contained in:
Liam Young 2016-04-18 12:27:35 +00:00
parent 4dd7af797e
commit dd5bc11622
2 changed files with 22 additions and 1 deletions

View File

@ -426,6 +426,8 @@ def do_openstack_upgrade(configs):
configs.set_release(openstack_release=new_os_rel) configs.set_release(openstack_release=new_os_rel)
# Before kilo it's nova-cloud-controllers job # Before kilo it's nova-cloud-controllers job
if is_elected_leader(CLUSTER_RES): if is_elected_leader(CLUSTER_RES):
# Stamping seems broken and unnecessary in liberty (Bug #1536675)
if os_release('neutron-common') < 'liberty':
stamp_neutron_database(cur_os_rel) stamp_neutron_database(cur_os_rel)
migrate_neutron_database() migrate_neutron_database()

View File

@ -292,6 +292,25 @@ class TestNeutronAPIUtils(CharmTestCase):
stamp_neutron_db.assert_called_with('icehouse') stamp_neutron_db.assert_called_with('icehouse')
migrate_neutron_db.assert_called_with() migrate_neutron_db.assert_called_with()
@patch.object(charmhelpers.contrib.openstack.utils,
'get_os_codename_install_source')
@patch.object(nutils, 'migrate_neutron_database')
@patch.object(nutils, 'stamp_neutron_database')
@patch.object(nutils, 'git_install_requested')
def test_do_openstack_upgrade_liberty(self, git_requested,
stamp_neutron_db, migrate_neutron_db,
gsrc):
git_requested.return_value = False
self.is_elected_leader.return_value = True
self.os_release.return_value = 'liberty'
self.config.side_effect = self.test_config.get
self.test_config.set('openstack-origin', 'cloud:trusty-mitaka')
gsrc.return_value = 'mitaka'
self.get_os_codename_install_source.return_value = 'mitaka'
configs = MagicMock()
nutils.do_openstack_upgrade(configs)
self.assertFalse(stamp_neutron_db.called)
@patch.object(charmhelpers.contrib.openstack.utils, @patch.object(charmhelpers.contrib.openstack.utils,
'get_os_codename_install_source') 'get_os_codename_install_source')
@patch.object(nutils, 'migrate_neutron_database') @patch.object(nutils, 'migrate_neutron_database')