summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-02-18 09:00:11 -0600
committerLuke Kanies <luke@madstop.com>2008-02-18 09:00:11 -0600
commit62d7616a457f33eb660454fcdcefe8dab84522c0 (patch)
tree9c1834604655f99c3b919a54f8719dcd93128c66
parentc34982439dce7fbd7a9686f2f73cc170d994ab50 (diff)
downloadpuppet-62d7616a457f33eb660454fcdcefe8dab84522c0.tar.gz
puppet-62d7616a457f33eb660454fcdcefe8dab84522c0.tar.xz
puppet-62d7616a457f33eb660454fcdcefe8dab84522c0.zip
Fixing the directory service provider's behaviour
when there's no value for a given attribute.
-rw-r--r--lib/puppet/provider/nameservice/directoryservice.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/puppet/provider/nameservice/directoryservice.rb b/lib/puppet/provider/nameservice/directoryservice.rb
index 973a62f6e..e2e68b2ca 100644
--- a/lib/puppet/provider/nameservice/directoryservice.rb
+++ b/lib/puppet/provider/nameservice/directoryservice.rb
@@ -139,10 +139,12 @@ class DirectoryService < Puppet::Provider::NameService
dscl_output.split("\n").each do |line|
# JJM: Split the attribute name and the list of values.
ds_attribute, ds_values_string = line.split(':')
+
+ # Split sets the values to nil if there's nothing after the :
+ ds_values_string ||= ""
# JJM: skip this attribute line if the Puppet::Type doesn't care about it.
- next unless (@@ds_to_ns_attribute_map.keys.include?(ds_attribute) \
- and type_properties.include? @@ds_to_ns_attribute_map[ds_attribute])
+ next unless (@@ds_to_ns_attribute_map.keys.include?(ds_attribute) and type_properties.include? @@ds_to_ns_attribute_map[ds_attribute])
# JJM: We asked dscl to output url encoded values so we're able
# to machine parse on whitespace. We need to urldecode: