summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2008-06-16 09:55:03 +1000
committerJames Turnbull <james@lovedthanlost.net>2008-06-16 09:55:03 +1000
commit6350aa4e81ff0fc0fd7effeee2b1e3ca8baaa351 (patch)
treeecd5e1d84446f4a335d3c277c7e5d9f2535bdc68
parent9a9780f377c4629d54da628bf65c9407a2b3314f (diff)
parentac7f59618a80b6a4aac777f6184e7fa6a0614079 (diff)
downloadpuppet-6350aa4e81ff0fc0fd7effeee2b1e3ca8baaa351.tar.gz
puppet-6350aa4e81ff0fc0fd7effeee2b1e3ca8baaa351.tar.xz
puppet-6350aa4e81ff0fc0fd7effeee2b1e3ca8baaa351.zip
Merge branch 'tickets/0.24.x/1201' of git://github.com/lak/puppet into 0.24.x
Conflicts: CHANGELOG
-rw-r--r--CHANGELOG2
-rw-r--r--lib/puppet/indirector/node/exec.rb7
-rwxr-xr-xspec/unit/indirector/node/exec.rb6
3 files changed, 15 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 66c1e996b..5239b469d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -3,6 +3,8 @@
LDAP nodes now use the certificate name, the short name, and 'default',
but external nodes just use the certificate name and any custom terminus
types will use just the certificate name.
+
+ Fixed #1201 - all external node attributes are converted to strings.
Adding a ResourceTemplate class for using templates directly
within resources (i.e., client-side templates). This would really
diff --git a/lib/puppet/indirector/node/exec.rb b/lib/puppet/indirector/node/exec.rb
index 52cbc370c..029a35c4f 100644
--- a/lib/puppet/indirector/node/exec.rb
+++ b/lib/puppet/indirector/node/exec.rb
@@ -30,6 +30,13 @@ class Puppet::Node::Exec < Puppet::Indirector::Exec
def create_node(name, result)
node = Puppet::Node.new(name)
set = false
+ if current = result[:parameters]
+ result[:parameters] = current.inject({}) do |strings, ary|
+ param, value = ary
+ strings[param] = value.to_s
+ strings
+ end
+ end
[:parameters, :classes, :environment].each do |param|
if value = result[param]
node.send(param.to_s + "=", value)
diff --git a/spec/unit/indirector/node/exec.rb b/spec/unit/indirector/node/exec.rb
index 09f13ab90..2276e4298 100755
--- a/spec/unit/indirector/node/exec.rb
+++ b/spec/unit/indirector/node/exec.rb
@@ -49,6 +49,12 @@ describe Puppet::Node::Exec do
@searcher.find(@request)
end
+ it "should convert all parameters into strings" do
+ @result[:parameters] = {"a" => true, "c" => 100}
+ @node.expects(:parameters=).with "a" => "true", "c" => "100"
+ @searcher.find(@request)
+ end
+
it "should set the resulting classes as the node classes" do
@result[:classes] = %w{one two}
@node.expects(:classes=).with %w{one two}