lib/kitchen/lifecycle_hooks.rb
def run_remote_hook(instance, state_file, hook)
      # Check if we're in a state that makes sense to even try.
      unless instance.last_action
        if hook[:skippable]
          # Just not even trying.
          return
        else
          raise UserError, "Cannot use remote lifecycle hooks during phases when the instance is not available"
        end
      end
      cmd = hook.delete(:remote)
      conn = instance.transport.connection(state_file.read)
      conn.execute(cmd)
    end
# Execute a specific remote command hook.
#
# @param instance [Instance] The instance object to run against.
# @param state_file [StateFile] Instance state file object.
# @param hook [Hash] Hook configration to use.
# @return [void]
Execute a specific remote command hook.
Execute a specific remote command hook .
def run_remote_hook(instance, state_file, hook)
      unless instance.last_action
        if hook[:skippable]
          return
        else
          raise UserError, "Cannot use remote lifecycle hooks during phases when the instance is not available"
        end
      end
      cmd = hook.delete(:remote)
      conn = instance.transport.connection(state_file.read)
      conn.execute(cmd)
    end
def run_remote_hook ( instance , state_file , hook ) unless instance . last_action if hook [ :skippable ] return else raise UserError , "Cannot use remote lifecycle hooks during phases when the instance is not available" end end cmd = hook . delete ( :remote ) conn = instance . transport . connection ( state_file . read ) conn . execute ( cmd ) end
Execute a specific remote command hook.
Execute a specific remote command hook .
# Check if we're in a state that makes sense to even try. # Just not even trying.
None
void
instance
The instance object to run against.
The instance object to run against .
state_file
Instance state file object.
Instance state file object .
hook
Hook configration to use.
Hook configration to use .