class Chef::GuardInterpreter::DefaultGuardInterpreter

Public Class Methods

new(command, opts) click to toggle source
# File lib/chef/guard_interpreter/default_guard_interpreter.rb, line 28
def initialize(command, opts)
  @command = command
  @command_opts = opts
end

Public Instance Methods

evaluate() click to toggle source
# File lib/chef/guard_interpreter/default_guard_interpreter.rb, line 35
def evaluate
  result = shell_out_with_systems_locale(@command, @command_opts)
  Chef::Log.debug "Command failed: #{result.stderr}" unless result.status.success?
  result.status.success?
# Timeout fails command rather than chef-client run, see:
#   https://tickets.opscode.com/browse/CHEF-2690
rescue Chef::Exceptions::CommandTimeout
  Chef::Log.warn "Command '#{@command}' timed out"
  false
end