diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index b0bba46e17c3..6754aceeda88 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -110,7 +110,6 @@ from nova.virt.libvirt import utils as libvirt_utils from nova.virt.libvirt import vif as libvirt_vif from nova.virt.libvirt.volume import remotefs from nova.virt import netutils -from nova.virt import watchdog_actions from nova.volume import cinder from nova.volume import encryptors @@ -4547,7 +4546,7 @@ class LibvirtDriver(driver.ComputeDriver): # NB(sross): currently only actually supported by KVM/QEmu if watchdog_action != 'disabled': - if watchdog_actions.is_valid_watchdog_action(watchdog_action): + if watchdog_action in fields.WatchdogAction.ALL: bark = vconfig.LibvirtConfigGuestWatchdog() bark.action = watchdog_action guest.add_device(bark) diff --git a/nova/virt/watchdog_actions.py b/nova/virt/watchdog_actions.py deleted file mode 100644 index e6af8ae66763..000000000000 --- a/nova/virt/watchdog_actions.py +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2014 Red Hat, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -"""Describes and verifies the watchdog device actions.""" - - -# the values which may be passed to libvirt -RAW_WATCHDOG_ACTIONS = ['poweroff', 'reset', 'pause', 'none'] - - -def is_valid_watchdog_action(val): - """Check if the given value is a valid watchdog device parameter.""" - return val in RAW_WATCHDOG_ACTIONS