~ubuntu-branches/ubuntu/precise/puppet/precise-security

« back to all changes in this revision

Viewing changes to lib/puppet/transaction/event.rb

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2013-06-14 09:06:22 UTC
  • Revision ID: package-import@ubuntu.com-20130614090622-udg81hzxap7nxrow
Tags: 2.7.11-1ubuntu2.3
* SECURITY UPDATE: Remote code execution on master from unauthenticated
  clients
  - debian/patches/2.7.21-Patch-for-CVE-2013-3567.patch: upstream patch
    to use safe_yama.
  - CVE-2013-3567

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
  EVENT_STATUSES = %w{noop success failure audit}
18
18
 
 
19
  def self.from_pson(data)
 
20
    obj = self.allocate
 
21
    obj.initialize_from_hash(data)
 
22
    obj
 
23
  end
 
24
 
19
25
  def initialize(options = {})
20
26
    @audited = false
21
27
    options.each { |attr, value| send(attr.to_s + "=", value) }
23
29
    @time = Time.now
24
30
  end
25
31
 
 
32
  def initialize_from_hash(data)
 
33
    @audited = data['audited']
 
34
    @property = data['property']
 
35
    @previous_value = data['previous_value']
 
36
    @desired_value = data['desired_value']
 
37
    @historical_value = data['historical_value']
 
38
    @message = data['message']
 
39
    @name = data['name'].intern
 
40
    @status = data['status']
 
41
    @time = data['time']
 
42
    @time = Time.parse(@time) if @time.is_a? String
 
43
  end
 
44
 
26
45
  def property=(prop)
27
46
    @property = prop.to_s
28
47
  end