[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. debian/0.24.7-1-98-gf19c0e5

James Turnbull james at lovedthanlost.net
Wed Apr 8 21:48:23 UTC 2009


The following commit has been merged in the master branch:
commit 2c7e1897eaaa7d2dd8d8d993df8a9a217d1c46c6
Author: Nigel Kersten <nigelk at google.com>
Date:   Mon Mar 16 07:30:16 2009 -0700

    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.

diff --git a/CHANGELOG b/CHANGELOG
index 4d5b05f..13bdd39 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 5dae8f1..44fc9a5 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 42c52f0..0e06bb0 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
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list