Merge "Follow-on to b6ed09e297 to fix docstrings/comments"

This commit is contained in:
Jenkins 2015-07-28 19:36:20 +00:00 committed by Gerrit Code Review
commit 29dd15092f
3 changed files with 17 additions and 16 deletions

View File

@ -133,10 +133,10 @@ CLEANING = 'cleaning'
""" Node is being automatically cleaned to prepare it for provisioning. """ """ Node is being automatically cleaned to prepare it for provisioning. """
CLEANWAIT = 'clean wait' 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 This will be the node's `provision_state` while the node is waiting for
the driver to finish cleaning step. the driver to finish a cleaning step.
""" """
CLEANFAIL = 'clean failed' CLEANFAIL = 'clean failed'
@ -289,7 +289,7 @@ machine.add_transition(CLEANING, AVAILABLE, 'done')
machine.add_transition(CLEANING, CLEANFAIL, 'fail') machine.add_transition(CLEANING, CLEANFAIL, 'fail')
machine.add_transition(CLEANWAIT, 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(CLEANING, CLEANWAIT, 'wait')
machine.add_transition(CLEANWAIT, CLEANING, 'resume') machine.add_transition(CLEANWAIT, CLEANING, 'resume')

View File

@ -843,7 +843,7 @@ class ConductorManager(periodic_task.PeriodicTasks):
purpose='node cleaning') as task: purpose='node cleaning') as task:
# TODO(lucasagomes): CLEANING here for backwards compat # TODO(lucasagomes): CLEANING here for backwards compat
# with previous code, otherwise nodes in CLEANING when this # 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. # release starts.
if task.node.provision_state not in (states.CLEANWAIT, if task.node.provision_state not in (states.CLEANWAIT,
states.CLEANING): states.CLEANING):
@ -857,7 +857,7 @@ class ConductorManager(periodic_task.PeriodicTasks):
'Failed to run next clean step') 'Failed to run next clean step')
# TODO(lucasagomes): This conditional is here for backwards # 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. # release starts.
if task.node.provision_state == states.CLEANWAIT: if task.node.provision_state == states.CLEANWAIT:
task.process_event('resume') task.process_event('resume')
@ -905,7 +905,7 @@ class ConductorManager(periodic_task.PeriodicTasks):
LOG.exception(msg) LOG.exception(msg)
return cleaning_error_handler(task, 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: if prepare_result == states.CLEANING:
LOG.warning(_LW('Returning CLEANING for asynchronous prepare ' LOG.warning(_LW('Returning CLEANING for asynchronous prepare '
'cleaning has been deprecated. Please use ' 'cleaning has been deprecated. Please use '
@ -972,7 +972,8 @@ class ConductorManager(periodic_task.PeriodicTasks):
cleaning_error_handler(task, msg) cleaning_error_handler(task, msg)
return 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: if result == states.CLEANING:
LOG.warning(_LW('Returning CLEANING for asynchronous clean ' LOG.warning(_LW('Returning CLEANING for asynchronous clean '
'steps has been deprecated. Please use ' 'steps has been deprecated. Please use '
@ -1098,15 +1099,15 @@ class ConductorManager(periodic_task.PeriodicTasks):
1) Node is mapped to this conductor. 1) Node is mapped to this conductor.
2) Node is not in maintenance mode. 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 4) Node doesn't have a reservation
NOTE: Grabbing a lock here can cause other methods to fail to 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 grab it. We want to avoid trying to grab a lock while a node
node is in the DEPLOYWAIT state so we don't unnecessarily is in the DEPLOYWAIT/CLEANWAIT state so we don't unnecessarily
cause a deploy callback to fail. There's not much we can do cause a deploy/cleaning callback to fail. There's not much we
here to avoid failing a brand new deploy to a node that we've can do here to avoid failing a brand new deploy to a node that
locked here, though. we've locked here, though.
""" """
# FIXME(comstud): Since our initial state checks are outside # FIXME(comstud): Since our initial state checks are outside
# of the lock (to try to avoid the lock), some checks are # of the lock (to try to avoid the lock), some checks are

View File

@ -265,7 +265,7 @@ class BaseAgentVendor(base.VendorInterface):
node.touch_provisioning() node.touch_provisioning()
# TODO(lucasagomes): CLEANING here for backwards compat # TODO(lucasagomes): CLEANING here for backwards compat
# with previous code, otherwise nodes in CLEANING when this # 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. # release starts.
elif (node.provision_state in (states.CLEANWAIT, states.CLEANING) elif (node.provision_state in (states.CLEANWAIT, states.CLEANING)
and not node.clean_step): and not node.clean_step):
@ -275,7 +275,7 @@ class BaseAgentVendor(base.VendorInterface):
self._notify_conductor_resume_clean(task) self._notify_conductor_resume_clean(task)
# TODO(lucasagomes): CLEANING here for backwards compat # TODO(lucasagomes): CLEANING here for backwards compat
# with previous code, otherwise nodes in CLEANING when this # 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. # release starts.
elif (node.provision_state in (states.CLEANWAIT, states.CLEANING) elif (node.provision_state in (states.CLEANWAIT, states.CLEANING)
and node.clean_step): and node.clean_step):