summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--CHANGELOG2
-rwxr-xr-xbin/ralsh4
-rw-r--r--lib/puppet/provider/nameservice/directoryservice.rb6
3 files changed, 9 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 4d5b05f40..13bdd3987 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,6 @@
0.24.8
+ Fixed #2077 - ralsh user broken on OSX
+
Fixed #2000 - No default specified for checksum
Fixed #2026 - Red Hat ignoring stop method
diff --git a/bin/ralsh b/bin/ralsh
index 5dae8f130..44fc9a568 100755
--- a/bin/ralsh
+++ b/bin/ralsh
@@ -88,6 +88,7 @@
require 'getoptlong'
require 'puppet'
+require 'facter'
options = [
[ "--debug", "-d", GetoptLong::NO_ARGUMENT ],
@@ -99,6 +100,9 @@ options = [
[ "--help", "-h", GetoptLong::NO_ARGUMENT ]
]
+# Load facts from Facter
+Facter.loadfacts
+
# Add all of the config parameters as valid options.
Puppet.settings.addargs(options)
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