summaryrefslogtreecommitdiffstats
path: root/lib/puppet/indirector/node
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-03-03 21:36:56 -0600
committerJames Turnbull <james@lovedthanlost.net>2009-03-05 08:22:10 +1100
commit61661b1c46fafeabf1bdbc4778762831d7178d91 (patch)
tree270f8dcb07cf818435a2f3c0e130d4a3b4436bb7 /lib/puppet/indirector/node
parentd5850dc40f20b6ea9429588c476eb0dca2d205b7 (diff)
downloadpuppet-61661b1c46fafeabf1bdbc4778762831d7178d91.tar.gz
puppet-61661b1c46fafeabf1bdbc4778762831d7178d91.tar.xz
puppet-61661b1c46fafeabf1bdbc4778762831d7178d91.zip
Fixing #1991 - ldap booleans get converted to booleans
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/indirector/node')
-rw-r--r--lib/puppet/indirector/node/ldap.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/puppet/indirector/node/ldap.rb b/lib/puppet/indirector/node/ldap.rb
index 759db3a5c..ab5d47b1c 100644
--- a/lib/puppet/indirector/node/ldap.rb
+++ b/lib/puppet/indirector/node/ldap.rb
@@ -103,6 +103,8 @@ class Puppet::Node::Ldap < Puppet::Indirector::Ldap
end
end
+ result[:parameters] = convert_parameters(result[:parameters])
+
result
end
@@ -143,6 +145,29 @@ class Puppet::Node::Ldap < Puppet::Indirector::Ldap
node.environment = information[:environment] if information[:environment]
end
+ def convert_parameters(parameters)
+ result = {}
+ parameters.each do |param, value|
+ if value.is_a?(Array)
+ result[param] = value.collect { |v| convert(v) }
+ else
+ result[param] = convert(value)
+ end
+ end
+ result
+ end
+
+ # Convert any values if necessary.
+ def convert(value)
+ case value
+ when Integer, Fixnum, Bignum; value
+ when "true"; true
+ when "false"; false
+ else
+ value
+ end
+ end
+
# Find information for our parent and merge it into the current info.
def find_and_merge_parent(parent, information)
unless parent_info = name2hash(parent)