class RBCM::Action::Command

Attributes

line[R]

Public Instance Methods

apply!() click to toggle source

execute the command remote

# File app/action/command.rb, line 24
def apply!
  @applied = true
  @result = @job.node.remote.execute(@line)
end
check!() click to toggle source

determine wether the command is neccessary

# File app/action/command.rb, line 5
def check!
  return if @obsolete != nil
  if @check.any?
    @obsolete = @check.all? do |check|
      @job.node.remote.execute(check).exitstatus == 0
    end
  else
    @obsolete = false
  end
end
siblings() click to toggle source

matching commands on other nodes to be approved at once

# File app/action/command.rb, line 17
def siblings
  @job.node.rbcm.actions.select{ |action|
    action.chain[1..-1] == @chain[1..-1] and action.line == @line
  } - [self]
end