Method: Puppet::Property::Ensure#change_to_s

Defined in:
lib/puppet/property/ensure.rb

#change_to_s(currentvalue, newvalue) ⇒ Object



54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/puppet/property/ensure.rb', line 54

def change_to_s(currentvalue, newvalue)
  if currentvalue == :absent || currentvalue.nil?
    _("created")
  elsif newvalue == :absent
    _("removed")
  else
    _('%{name} changed %{is} to %{should}') % { name: name, is: is_to_s(currentvalue), should: should_to_s(newvalue) }
  end
rescue Puppet::Error
  raise
rescue => detail
  raise Puppet::DevError, _("Could not convert change %{name} to string: %{detail}") % { name: name, detail: detail }, detail.backtrace
end