summaryrefslogtreecommitdiffstats
path: root/lib/puppet/node
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-05-12 14:26:49 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-05-12 14:26:49 -0700
commit704623cb95aacb0544609620994dc36f61a4b463 (patch)
tree6706dc7afa05bf4bbffb2ab7e616717fb6af0c86 /lib/puppet/node
parent9d73b73594d4bf9fe4e8abb369ffc5887b15f4ec (diff)
parentc21539fe2205fc61ca9e0a49b3b2702e76931632 (diff)
Merge branch '2.7.next' into next
Diffstat (limited to 'lib/puppet/node')
-rwxr-xr-xlib/puppet/node/facts.rb20
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/puppet/node/facts.rb b/lib/puppet/node/facts.rb
index 2ff7156c8..577b62b62 100755
--- a/lib/puppet/node/facts.rb
+++ b/lib/puppet/node/facts.rb
@@ -61,22 +61,18 @@ class Puppet::Node::Facts
def self.from_pson(data)
result = new(data['name'], data['values'])
- result.timestamp = Time.parse(data['timestamp']) if data['timestamp']
- result.expiration = Time.parse(data['expiration']) if data['expiration']
+ result.timestamp = Time.parse(data['timestamp'])
+ result.expiration = Time.parse(data['expiration'])
result
end
def to_pson(*args)
- result = {
- 'document_type' => "Puppet::Node::Facts",
- 'data' => {}
- }
-
- result['data']['name'] = name
- result['data']['expiration'] = expiration if expiration
- result['data']['timestamp'] = timestamp if timestamp
- result['data']['values'] = strip_internal
- result.to_pson(*args)
+ {
+ 'expiration' => expiration,
+ 'name' => name,
+ 'timestamp' => timestamp,
+ 'values' => strip_internal,
+ }.to_pson(*args)
end
# Add internal data to the facts for storage.