summaryrefslogtreecommitdiffstats
path: root/lib/puppet/node
diff options
context:
space:
mode:
authorMax Martin <max@puppetlabs.com>2011-04-21 19:04:04 -0700
committerMax Martin <max@puppetlabs.com>2011-04-21 19:04:04 -0700
commit1e9cc2cbf984633ab7ac63d466b3e4db8bca1445 (patch)
tree41991d2994934031c7e7671544d427f1d0a09257 /lib/puppet/node
parente185be0a6d35c84a60b940f233f87c0908547dee (diff)
parent2a2226c0b71aafcda953057d3ecc8df5638447f2 (diff)
downloadpuppet-1e9cc2cbf984633ab7ac63d466b3e4db8bca1445.tar.gz
puppet-1e9cc2cbf984633ab7ac63d466b3e4db8bca1445.tar.xz
puppet-1e9cc2cbf984633ab7ac63d466b3e4db8bca1445.zip
Merge branch 'ticket/2.7.x/7080-reverts' into 2.7.x
* ticket/2.7.x/7080-reverts: Revert "Fixing Facts pson methods more resilient" Revert "(7080) Adding json support to Indirector Request" Revert "Adding json support to Puppet::Node"
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.