]> xenbits.xensource.com Git - osstest/openstack-nova.git/commitdiff
Remove watchdog_actions module
authorMatt Riedemann <mriedem@us.ibm.com>
Thu, 13 Oct 2016 17:42:52 +0000 (13:42 -0400)
committerMatt Riedemann <mriedem@us.ibm.com>
Thu, 13 Oct 2016 17:42:52 +0000 (13:42 -0400)
The only purpose of the watchdog_actions module was
for a helper method to check against a list of enums
which are also defined in the WatchdogAction enum
field, so remove the module and just use the field enums.

Change-Id: I0de5fc4efc0ae0b5fe11a56669e180b450d3410a

nova/virt/libvirt/driver.py
nova/virt/watchdog_actions.py [deleted file]

index 25a668552fc25e3b8ae48d49e6d748c30ed25441..07a2f929446c5a8eb0b2f97b437710e1c46940ea 100644 (file)
@@ -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
 
@@ -4552,7 +4551,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 (file)
index e6af8ae..0000000
+++ /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