diff options
Diffstat (limited to 'lib/puppet/interface.rb')
-rw-r--r-- | lib/puppet/interface.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/puppet/interface.rb b/lib/puppet/interface.rb index 70484adfc..07e27efa8 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 |