Method: Puppet::Indirector::Face#call_indirection_method

Defined in:
lib/puppet/indirector/face.rb

#call_indirection_method(method, key, options) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/puppet/indirector/face.rb', line 42

def call_indirection_method(method, key, options)
  begin
    if method == :save
      # key is really the instance to save
      result = indirection.__send__(method, key, nil, options)
    else
      result = indirection.__send__(method, key, options)
    end
  rescue => detail
    message = _("Could not call '%{method}' on '%{indirection}': %{detail}") % { method: method, indirection: indirection_name, detail: detail }
    Puppet.log_exception(detail, message)
    raise RuntimeError, message, detail.backtrace
  end

  result
end