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
This commit is contained in:
parent
50f7b064d7
commit
fa4ad0a2fe
@ -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"}})
|
||||
|
@ -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)
|
||||
|
@ -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**.
|
Loading…
Reference in New Issue
Block a user