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

Daniel Pittman daniel at puppetlabs.com
Tue May 10 08:11:34 UTC 2011


The following commit has been merged in the experimental branch:
commit d9f23c0801d7d40809326face37463aeb67a3cdd
Author: Dan Bode <dan at puppetlabs.com>
Date:   Thu Apr 7 16:18:27 2011 -0700

    (#6969) String failures differentiate between invalid string/version
    
    This patch does two things:
    
    1. splits out the string lookup functionality from define into a seperate
    method []
    2. Tries to both load the specific version of a string as well as the
    current version so that specific error messages can be returned
    differentiating between an invalid version/string.
    
    Reviewed-By: Daniel Pittman <daniel at puppetlabs.com>

diff --git a/lib/puppet/interface.rb b/lib/puppet/interface.rb
index 70484ad..07e27ef 100644
--- a/lib/puppet/interface.rb
+++ b/lib/puppet/interface.rb
@@ -50,7 +50,16 @@ class Puppet::Interface
       return face
     end
 
-    alias :[] :define
+    def [](name, version)
+      unless face = Puppet::Interface::FaceCollection[name, version]
+        if current = Puppet::Interface::FaceCollection[name, :current]
+          raise Puppet::Error, "Could not find version #{version} of #{current}"
+        else
+          raise Puppet::Error, "Could not find Puppet Face #{name.inspect}"
+        end
+      end
+      face
+    end
   end
 
   attr_accessor :default_format

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list