summaryrefslogtreecommitdiff
path: root/ironic/drivers/modules/inspector.py
diff options
context:
space:
mode:
authorKaifeng Wang <kaifeng.w@gmail.com>2018-03-22 17:35:00 +0800
committerKaifeng Wang <kaifeng.w@gmail.com>2018-04-10 11:21:46 +0800
commit6df82ee2bcc702168e80ec7c81e5573d766f9c71 (patch)
treebe92ca71643c21378fcbde57d35d992a75ccdc7f /ironic/drivers/modules/inspector.py
parentc03dfbf2eb4eb4242c3848c40f3faf42c142e8a9 (diff)
downloadironic-6df82ee2bcc702168e80ec7c81e5573d766f9c71.tar.gz
Implementation of inspect wait state
This patch provides implementations to feature of adding inspect wait state. Changes covered in this patch: * Added state and transitions, state diagram regenerated. * inspector and oneview inspect interface now return INSPECTWAIT instead of INSPECTING. Move node to inspect wait if inspect interface returns INSPECTING or INSPECTWAIT. * Add a timeout option to conductor, and a periodic task to check timeout in the inspect wait state. Story: #1725211 Task: #10630 Partial-Bug: #1725211 Change-Id: Ie76bfdad5966014a4dae826919ff5705462c743b
Diffstat (limited to 'ironic/drivers/modules/inspector.py')
-rw-r--r--ironic/drivers/modules/inspector.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ironic/drivers/modules/inspector.py b/ironic/drivers/modules/inspector.py
index 2642a83a6..25104ee84 100644
--- a/ironic/drivers/modules/inspector.py
+++ b/ironic/drivers/modules/inspector.py
@@ -119,7 +119,7 @@ class Inspector(base.InspectInterface):
ironic-inspector. Results will be checked in a periodic task.
:param task: a task from TaskManager.
- :returns: states.INSPECTING
+ :returns: states.INSPECTWAIT
"""
LOG.debug('Starting inspection for node %(uuid)s using '
'ironic-inspector', {'uuid': task.node.uuid})
@@ -128,13 +128,13 @@ class Inspector(base.InspectInterface):
# we can release a lock as soon as possible and allow ironic-inspector
# to operate on a node.
eventlet.spawn_n(_start_inspection, task.node.uuid, task.context)
- return states.INSPECTING
+ return states.INSPECTWAIT
@periodics.periodic(spacing=CONF.inspector.status_check_period,
enabled=CONF.inspector.enabled)
def _periodic_check_result(self, manager, context):
"""Periodic task checking results of inspection."""
- filters = {'provision_state': states.INSPECTING}
+ filters = {'provision_state': states.INSPECTWAIT}
node_iter = manager.iter_nodes(filters=filters)
for node_uuid, driver in node_iter:
@@ -171,7 +171,7 @@ def _start_inspection(node_uuid, context):
def _check_status(task):
"""Check inspection status for node given by a task."""
node = task.node
- if node.provision_state != states.INSPECTING:
+ if node.provision_state != states.INSPECTWAIT:
return
if not isinstance(task.driver.inspect, Inspector):
return