A simple struct for storing what happens on the system.
# File lib/puppet/transaction/event.rb, line 21 def initialize(options = {}) @audited = false set_options(options) @time = Time.now end
# File lib/puppet/transaction/event.rb, line 27 def property=(prop) @property = prop.to_s end
# File lib/puppet/transaction/event.rb, line 31 def resource=(res) begin # In Ruby 1.8 looking up a symbol on a string gives nil; in 1.9 it will # raise a TypeError, which we then catch. This should work on both # versions, for all that it is a bit naff. --daniel 2012-03-11 if res.respond_to?(:[]) and level = res[:loglevel] @default_log_level = level end rescue TypeError => e raise unless e.to_s == "can't convert Symbol into Integer" end @resource = res.to_s end
# File lib/puppet/transaction/event.rb, line 45 def send_log super(log_level, message) end
# File lib/puppet/transaction/event.rb, line 49 def status=(value) raise ArgumentError, "Event status can only be #{EVENT_STATUSES.join(', ')}" unless EVENT_STATUSES.include?(value) @status = value end
# File lib/puppet/transaction/event.rb, line 54 def to_s message end
# File lib/puppet/transaction/event.rb, line 58 def to_yaml_properties YAML_ATTRIBUTES & instance_variables end