[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Matt Robinson matt at puppetlabs.com
Tue May 10 08:09:12 UTC 2011


The following commit has been merged in the experimental branch:
commit bfac57a0e5e12f92c92182adae1595d4a49ca5a7
Author: Matt Robinson <matt at puppetlabs.com>
Date:   Sat Mar 26 10:03:51 2011 -0700

    (#6830) Fix File class scoping
    
    As seen in other Ruby 1.9 compatibility patches already.  Fixes errors
    like:
    
      undefined method `dirname' for Puppet::Type::File:Class
    
    Reviewed-by: Jesse Wolfe <jesse at puppetlabs.com>

diff --git a/lib/puppet/type/tidy.rb b/lib/puppet/type/tidy.rb
index 93a7e96..146481f 100755
--- a/lib/puppet/type/tidy.rb
+++ b/lib/puppet/type/tidy.rb
@@ -254,7 +254,7 @@ Puppet::Type.newtype(:tidy) do
 
     if parameter
       files = Puppet::FileServing::Fileset.new(self[:path], parameter).files.collect do |f|
-        f == "." ? self[:path] : File.join(self[:path], f)
+        f == "." ? self[:path] : ::File.join(self[:path], f)
       end
     else
       files = [self[:path]]
@@ -270,7 +270,7 @@ Puppet::Type.newtype(:tidy) do
     files_by_name = result.inject({}) { |hash, file| hash[file[:path]] = file; hash }
 
     files_by_name.keys.sort { |a,b| b <=> b }.each do |path|
-      dir = File.dirname(path)
+      dir = ::File.dirname(path)
       next unless resource = files_by_name[dir]
       if resource[:require]
         resource[:require] << Puppet::Resource.new(:file, path)
@@ -321,7 +321,7 @@ Puppet::Type.newtype(:tidy) do
 
   def stat(path)
     begin
-      File.lstat(path)
+      ::File.lstat(path)
     rescue Errno::ENOENT => error
       info "File does not exist"
       return nil
diff --git a/lib/puppet/type/zone.rb b/lib/puppet/type/zone.rb
index 1bae931..0fc702c 100644
--- a/lib/puppet/type/zone.rb
+++ b/lib/puppet/type/zone.rb
@@ -409,7 +409,7 @@ Puppet::Type.newtype(:zone) do
   # both as prerequisites.
   autorequire(:file) do
     if @parameters.include? :path
-      [@parameters[:path].value, File.dirname(@parameters[:path].value)]
+      [@parameters[:path].value, ::File.dirname(@parameters[:path].value)]
     else
       nil
     end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list