diff --git a/hooks/neutron_api_utils.py b/hooks/neutron_api_utils.py index fd1a6695..02120d60 100755 --- a/hooks/neutron_api_utils.py +++ b/hooks/neutron_api_utils.py @@ -426,7 +426,9 @@ def do_openstack_upgrade(configs): configs.set_release(openstack_release=new_os_rel) # Before kilo it's nova-cloud-controllers job if is_elected_leader(CLUSTER_RES): - stamp_neutron_database(cur_os_rel) + # Stamping seems broken and unnecessary in liberty (Bug #1536675) + if os_release('neutron-common') < 'liberty': + stamp_neutron_database(cur_os_rel) migrate_neutron_database() diff --git a/unit_tests/test_neutron_api_utils.py b/unit_tests/test_neutron_api_utils.py index 1acad2af..345058ae 100644 --- a/unit_tests/test_neutron_api_utils.py +++ b/unit_tests/test_neutron_api_utils.py @@ -292,6 +292,25 @@ class TestNeutronAPIUtils(CharmTestCase): stamp_neutron_db.assert_called_with('icehouse') 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, 'get_os_codename_install_source') @patch.object(nutils, 'migrate_neutron_database')