Follow-on to b6ed09e297
to fix docstrings/comments
Follow up patch to fix docstrings and comments left on b6ed09e297
.
Change-Id: I73edb0202af673bda0b668b8e9779315565eac7b
This commit is contained in:
parent
6f0011786b
commit
1db86293f0
@ -133,10 +133,10 @@ CLEANING = 'cleaning'
|
||||
""" Node is being automatically cleaned to prepare it for provisioning. """
|
||||
|
||||
CLEANWAIT = 'clean wait'
|
||||
""" Node is waiting to be cleaned.
|
||||
""" Node is waiting for a clean step to be finished.
|
||||
|
||||
This will be the node `provision_state` while the node is waiting for
|
||||
the driver to finish cleaning step.
|
||||
This will be the node's `provision_state` while the node is waiting for
|
||||
the driver to finish a cleaning step.
|
||||
"""
|
||||
|
||||
CLEANFAIL = 'clean failed'
|
||||
@ -289,7 +289,7 @@ machine.add_transition(CLEANING, AVAILABLE, 'done')
|
||||
machine.add_transition(CLEANING, CLEANFAIL, 'fail')
|
||||
machine.add_transition(CLEANWAIT, CLEANFAIL, 'fail')
|
||||
|
||||
# A deployment may also wait on external callbacks
|
||||
# Cleaning may also wait on external callbacks
|
||||
machine.add_transition(CLEANING, CLEANWAIT, 'wait')
|
||||
machine.add_transition(CLEANWAIT, CLEANING, 'resume')
|
||||
|
||||
|
@ -843,7 +843,7 @@ class ConductorManager(periodic_task.PeriodicTasks):
|
||||
purpose='node cleaning') as task:
|
||||
# TODO(lucasagomes): CLEANING here for backwards compat
|
||||
# with previous code, otherwise nodes in CLEANING when this
|
||||
# is deployed would fail. Should be removed once the M
|
||||
# is deployed would fail. Should be removed once the Mitaka
|
||||
# release starts.
|
||||
if task.node.provision_state not in (states.CLEANWAIT,
|
||||
states.CLEANING):
|
||||
@ -857,7 +857,7 @@ class ConductorManager(periodic_task.PeriodicTasks):
|
||||
'Failed to run next clean step')
|
||||
|
||||
# TODO(lucasagomes): This conditional is here for backwards
|
||||
# compat with previous code. Should be removed once the M
|
||||
# compat with previous code. Should be removed once the Mitaka
|
||||
# release starts.
|
||||
if task.node.provision_state == states.CLEANWAIT:
|
||||
task.process_event('resume')
|
||||
@ -905,7 +905,7 @@ class ConductorManager(periodic_task.PeriodicTasks):
|
||||
LOG.exception(msg)
|
||||
return cleaning_error_handler(task, msg)
|
||||
|
||||
# TODO(lucasagomes): Should be removed once the M release starts
|
||||
# TODO(lucasagomes): Should be removed once the Mitaka release starts
|
||||
if prepare_result == states.CLEANING:
|
||||
LOG.warning(_LW('Returning CLEANING for asynchronous prepare '
|
||||
'cleaning has been deprecated. Please use '
|
||||
@ -972,7 +972,8 @@ class ConductorManager(periodic_task.PeriodicTasks):
|
||||
cleaning_error_handler(task, msg)
|
||||
return
|
||||
|
||||
# TODO(lucasagomes): Should be removed once the M release starts
|
||||
# TODO(lucasagomes): Should be removed once the Mitaka
|
||||
# release starts
|
||||
if result == states.CLEANING:
|
||||
LOG.warning(_LW('Returning CLEANING for asynchronous clean '
|
||||
'steps has been deprecated. Please use '
|
||||
@ -1098,15 +1099,15 @@ class ConductorManager(periodic_task.PeriodicTasks):
|
||||
|
||||
1) Node is mapped to this conductor.
|
||||
2) Node is not in maintenance mode.
|
||||
3) Node is not in DEPLOYWAIT provision state.
|
||||
3) Node is not in DEPLOYWAIT/CLEANWAIT provision state.
|
||||
4) Node doesn't have a reservation
|
||||
|
||||
NOTE: Grabbing a lock here can cause other methods to fail to
|
||||
grab it. We want to avoid trying to grab a lock while a
|
||||
node is in the DEPLOYWAIT state so we don't unnecessarily
|
||||
cause a deploy callback to fail. There's not much we can do
|
||||
here to avoid failing a brand new deploy to a node that we've
|
||||
locked here, though.
|
||||
grab it. We want to avoid trying to grab a lock while a node
|
||||
is in the DEPLOYWAIT/CLEANWAIT state so we don't unnecessarily
|
||||
cause a deploy/cleaning callback to fail. There's not much we
|
||||
can do here to avoid failing a brand new deploy to a node that
|
||||
we've locked here, though.
|
||||
"""
|
||||
# FIXME(comstud): Since our initial state checks are outside
|
||||
# of the lock (to try to avoid the lock), some checks are
|
||||
|
@ -265,7 +265,7 @@ class BaseAgentVendor(base.VendorInterface):
|
||||
node.touch_provisioning()
|
||||
# TODO(lucasagomes): CLEANING here for backwards compat
|
||||
# with previous code, otherwise nodes in CLEANING when this
|
||||
# is deployed would fail. Should be removed once the M
|
||||
# is deployed would fail. Should be removed once the Mitaka
|
||||
# release starts.
|
||||
elif (node.provision_state in (states.CLEANWAIT, states.CLEANING)
|
||||
and not node.clean_step):
|
||||
@ -275,7 +275,7 @@ class BaseAgentVendor(base.VendorInterface):
|
||||
self._notify_conductor_resume_clean(task)
|
||||
# TODO(lucasagomes): CLEANING here for backwards compat
|
||||
# with previous code, otherwise nodes in CLEANING when this
|
||||
# is deployed would fail. Should be removed once the M
|
||||
# is deployed would fail. Should be removed once the Mitaka
|
||||
# release starts.
|
||||
elif (node.provision_state in (states.CLEANWAIT, states.CLEANING)
|
||||
and node.clean_step):
|
||||
|
Loading…
Reference in New Issue
Block a user