summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNigel Kersten <nigelk@google.com>2009-03-16 07:30:16 -0700
committerJames Turnbull <james@lovedthanlost.net>2009-03-20 18:22:00 +1100
commit2c7e1897eaaa7d2dd8d8d993df8a9a217d1c46c6 (patch)
treec98fbc812ca570798de73be5d6b213370736c97d /lib
parent73a0757b559d7e4fbd1da43bbcf4e60fd9155896 (diff)
downloadpuppet-2c7e1897eaaa7d2dd8d8d993df8a9a217d1c46c6.tar.gz
puppet-2c7e1897eaaa7d2dd8d8d993df8a9a217d1c46c6.tar.xz
puppet-2c7e1897eaaa7d2dd8d8d993df8a9a217d1c46c6.zip
Fixes incorrect detail variable in OS X version check, re-patches ralsh to work with Facter values and adds error check for missing password hash files.
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/provider/nameservice/directoryservice.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/puppet/provider/nameservice/directoryservice.rb b/lib/puppet/provider/nameservice/directoryservice.rb
index 42c52f0a7..0e06bb089 100644
--- a/lib/puppet/provider/nameservice/directoryservice.rb
+++ b/lib/puppet/provider/nameservice/directoryservice.rb
@@ -118,7 +118,7 @@ class DirectoryService < Puppet::Provider::NameService
begin
product_version = Facter.value(:macosx_productversion)
if product_version.nil?
- raise Puppet::Error, "Could not determine OS X version: %s" % detail
+ raise Puppet::Error, "Could not determine OS X version"
end
product_version_major = product_version.scan(/(\d+)\.(\d+)./).join(".")
if %w{10.0 10.1 10.2 10.3}.include?(product_version_major)
@@ -320,14 +320,14 @@ class DirectoryService < Puppet::Provider::NameService
def self.get_password(guid)
password_hash = nil
password_hash_file = "#{@@password_hash_dir}/#{guid}"
- if File.exists?(password_hash_file)
+ if File.exists?(password_hash_file) and File.file?(password_hash_file)
if not File.readable?(password_hash_file)
raise Puppet::Error("Could not read password hash file at #{password_hash_file} for #{@resource[:name]}")
end
f = File.new(password_hash_file)
password_hash = f.read
f.close
- end
+ end
password_hash
end