original_docstring: Turn the power to this node OFF.
docstring: Turn the power to this node OFF.
docstring_tokens: Turn the power to this node OFF .
code: def _power_off(self):
          """Turn the power to this node OFF."""
  
          def _wait_for_power_off():
              """Called at an interval until the node's power is off."""
  
              if self._is_power("off"):
                  self.state = baremetal_states.DELETED
                  raise utils.LoopingCallDone()
              if self.retries > CONF.baremetal.ipmi_power_retry:
                  self.state = baremetal_states.ERROR
                  raise utils.LoopingCallDone()
              try:
                  self.retries += 1
                  self._exec_ipmitool("power off")
              except Exception:
                  LOG.exception(_("IPMI power off failed"))
  
          self.retries = 0
          timer = utils.FixedIntervalLoopingCall(_wait_for_power_off)
          timer.start(interval=0.5).wait()
code_tokens: def _power_off ( self ) : def _wait_for_power_off ( ) : """Called at an interval until the node's power is off.""" if self . _is_power ( "off" ) : self . state = baremetal_states . DELETED raise utils . LoopingCallDone ( ) if self . retries > CONF . baremetal . ipmi_power_retry : self . state = baremetal_states . ERROR raise utils . LoopingCallDone ( ) try : self . retries += 1 self . _exec_ipmitool ( "power off" ) except Exception : LOG . exception ( _ ( "IPMI power off failed" ) ) self . retries = 0 timer = utils . FixedIntervalLoopingCall ( _wait_for_power_off ) timer . start ( interval = 0.5 ) . wait ( )
short_docstring: Turn the power to this node OFF.
short_docstring_tokens: Turn the power to this node OFF .
comment: """Turn the power to this node OFF."""$SEP$"""Called at an interval until the node's power is off."""