From fa4ad0a2fef231e690059270d5b7070809b52a3e Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Thu, 13 Oct 2016 14:41:27 -0400 Subject: [PATCH] Drop deprecated support for hw_watchdog_action flavor extra spec Since change Ic5344ec34a130ee5a0ed2c7348af0b9d79e3508e which goes back to Icehouse we've allowed using hw_watchdog_action for both image metadata and flavor extra specs, even though you should use hw:watchdog_action for flavor extra specs. Well, it's finally time to remove the transition support for hw_watchdog_action in flavor extra specs. Change-Id: Ibf7bc549af498e2355ebdaf9e5d3337554a7f3d6 --- nova/tests/unit/virt/libvirt/test_driver.py | 17 +++-------------- nova/virt/libvirt/driver.py | 12 +++--------- ...vor_hw_watchdog_action-512d79155c91cb84.yaml | 6 ++++++ 3 files changed, 12 insertions(+), 23 deletions(-) create mode 100644 releasenotes/notes/flavor_hw_watchdog_action-512d79155c91cb84.yaml diff --git a/nova/tests/unit/virt/libvirt/test_driver.py b/nova/tests/unit/virt/libvirt/test_driver.py index 70d5c09b5fd0..2a1f7d57fb7b 100644 --- a/nova/tests/unit/virt/libvirt/test_driver.py +++ b/nova/tests/unit/virt/libvirt/test_driver.py @@ -4282,14 +4282,13 @@ class LibvirtConnTestCase(test.NoDBTestCase): self._test_get_guest_usb_tablet, True, True, vm_mode.XEN, image_meta=image_meta) - def _test_get_guest_config_with_watchdog_action_flavor(self, - hw_watchdog_action="hw:watchdog_action"): + def test_get_guest_config_with_watchdog_action_flavor(self): self.flags(virt_type='kvm', group='libvirt') drvr = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True) instance_ref = objects.Instance(**self.test_instance) - instance_ref.flavor.extra_specs = {hw_watchdog_action: 'none'} + instance_ref.flavor.extra_specs = {"hw:watchdog_action": 'none'} image_meta = objects.ImageMeta.from_dict(self.test_image_meta) disk_info = blockinfo.get_disk_info(CONF.libvirt.virt_type, @@ -4321,23 +4320,13 @@ class LibvirtConnTestCase(test.NoDBTestCase): self.assertEqual("none", cfg.devices[7].action) - def test_get_guest_config_with_watchdog_action_through_flavor(self): - self._test_get_guest_config_with_watchdog_action_flavor() - - # TODO(pkholkin): the test accepting old property name 'hw_watchdog_action' - # should be removed in the next release - def test_get_guest_config_with_watchdog_action_through_flavor_no_scope( - self): - self._test_get_guest_config_with_watchdog_action_flavor( - hw_watchdog_action="hw_watchdog_action") - def test_get_guest_config_with_watchdog_overrides_flavor(self): self.flags(virt_type='kvm', group='libvirt') drvr = libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), True) instance_ref = objects.Instance(**self.test_instance) - instance_ref.flavor.extra_specs = {'hw_watchdog_action': 'none'} + instance_ref.flavor.extra_specs = {'hw:watchdog_action': 'none'} image_meta = objects.ImageMeta.from_dict({ "disk_format": "raw", "properties": {"hw_watchdog_action": "pause"}}) diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 07a2f929446c..a3bd36bf1fdc 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -4536,15 +4536,9 @@ class LibvirtDriver(driver.ComputeDriver): raise exception.PciDeviceUnsupportedHypervisor( type=virt_type) - if 'hw_watchdog_action' in flavor.extra_specs: - LOG.warning(_LW('Old property name "hw_watchdog_action" is now ' - 'deprecated and will be removed in the next release. ' - 'Use updated property name ' - '"hw:watchdog_action" instead'), instance=instance) - # TODO(pkholkin): accepting old property name 'hw_watchdog_action' - # should be removed in the next release - watchdog_action = (flavor.extra_specs.get('hw_watchdog_action') or - flavor.extra_specs.get('hw:watchdog_action') + # image meta takes precedence over flavor extra specs; disable the + # watchdog action by default + watchdog_action = (flavor.extra_specs.get('hw:watchdog_action') or 'disabled') watchdog_action = image_meta.properties.get('hw_watchdog_action', watchdog_action) diff --git a/releasenotes/notes/flavor_hw_watchdog_action-512d79155c91cb84.yaml b/releasenotes/notes/flavor_hw_watchdog_action-512d79155c91cb84.yaml new file mode 100644 index 000000000000..3321a7ab27cb --- /dev/null +++ b/releasenotes/notes/flavor_hw_watchdog_action-512d79155c91cb84.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + Support for **hw_watchdog_action** as a flavor extra spec has been removed. + The valid flavor extra spec is **hw:watchdog_action** and the image + property, which takes precedence, is **hw_watchdog_action**.