Last active
December 31, 2015 23:49
-
-
Save grimradical/8062457 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| puppet/lib/puppet/indirector/facts/puppetdb.rb | 3 ++- | |
| puppet/spec/unit/indirector/facts/puppetdb_spec.rb | 3 ++- | |
| 2 files changed, 4 insertions(+), 2 deletions(-) | |
| diff --git a/puppet/lib/puppet/indirector/facts/puppetdb.rb b/puppet/lib/puppet/indirector/facts/puppetdb.rb | |
| index e4e08e4..da36497 100644 | |
| --- a/puppet/lib/puppet/indirector/facts/puppetdb.rb | |
| +++ b/puppet/lib/puppet/indirector/facts/puppetdb.rb | |
| @@ -10,8 +10,9 @@ class Puppet::Node::Facts::Puppetdb < Puppet::Indirector::REST | |
| facts = request.instance.dup | |
| facts.values = facts.values.dup | |
| facts.stringify | |
| + payload = {"name" => facts.name, "values" => facts.values}.to_pson | |
| - submit_command(request.key, facts.to_pson, CommandReplaceFacts, 1) | |
| + submit_command(request.key, payload, CommandReplaceFacts, 1) | |
| end | |
| def find(request) | |
| diff --git a/puppet/spec/unit/indirector/facts/puppetdb_spec.rb b/puppet/spec/unit/indirector/facts/puppetdb_spec.rb | |
| index 93242bf..6b4169b 100644 | |
| --- a/puppet/spec/unit/indirector/facts/puppetdb_spec.rb | |
| +++ b/puppet/spec/unit/indirector/facts/puppetdb_spec.rb | |
| @@ -30,10 +30,11 @@ describe Puppet::Node::Facts::Puppetdb do | |
| it "should POST the facts command as a URL-encoded PSON string" do | |
| facts.stringify | |
| + f = {"name" => facts.name, "values" => facts.values} | |
| payload = { | |
| :command => CommandReplaceFacts, | |
| :version => 1, | |
| - :payload => facts.to_pson, | |
| + :payload => f.to_pson, | |
| }.to_pson | |
| http.expects(:post).with do |uri, body, headers| |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment