diff options
author | Max Martin <max@puppetlabs.com> | 2011-04-21 15:26:29 -0700 |
---|---|---|
committer | Max Martin <max@puppetlabs.com> | 2011-04-21 15:26:29 -0700 |
commit | e4b31b411a4b3d7cce7f45197491eebc36d047aa (patch) | |
tree | d8703468b9b598c196348b748fbe47333b31a745 /lib/puppet/interface.rb | |
parent | 01f610bb223b435dc52f491260af3ea002930102 (diff) | |
parent | 2591a539481710e228e96c57b85434c1b9951c15 (diff) | |
download | puppet-e4b31b411a4b3d7cce7f45197491eebc36d047aa.tar.gz puppet-e4b31b411a4b3d7cce7f45197491eebc36d047aa.tar.xz puppet-e4b31b411a4b3d7cce7f45197491eebc36d047aa.zip |
Merge branch '2.7.next' into next
* 2.7.next:
(#6928) Don't blow up when the method is undefined...
(#6928) backport Symbol#to_proc for Ruby < 1.8.7
(#7183) Implement "invisible glob" version matching for faces
maint: better disabling of Signal#trap in our tests.
maint: more robust listing of valid faces.
maint: clean up testing code a fraction...
maint: better error report for a missing version of a face.
maint: handle face clear/reset sanely in the interface spec.
maint: stop stubbing log level setting.
Move tests from Puppet-acceptance repo
(#7116) Handle application-level options in parse_options
maint: fix gratuitous whitespace in the code.
maint: remove redundant context from the test.
(#7062) better argument handling in the action wrapper methods
maint: move method comments outside the comment.
Fixed #7166 - Replaced deprecated stomp "send" method with "publish"
maint: Remove unused faces code
Diffstat (limited to 'lib/puppet/interface.rb')
-rw-r--r-- | lib/puppet/interface.rb | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/puppet/interface.rb b/lib/puppet/interface.rb index 5c8ade749..ced00863d 100644 --- a/lib/puppet/interface.rb +++ b/lib/puppet/interface.rb @@ -26,18 +26,13 @@ class Puppet::Interface Puppet::Interface::FaceCollection.faces end - def face?(name, version) - Puppet::Interface::FaceCollection.face?(name, version) - end - def register(instance) Puppet::Interface::FaceCollection.register(instance) end def define(name, version, &block) - if face?(name, version) - face = Puppet::Interface::FaceCollection[name, version] - else + face = Puppet::Interface::FaceCollection[name, version] + if face.nil? then face = self.new(name, version) Puppet::Interface::FaceCollection.register(face) # REVISIT: Shouldn't this be delayed until *after* we evaluate the @@ -50,10 +45,14 @@ class Puppet::Interface return face end + def face?(name, version) + Puppet::Interface::FaceCollection[name, version] + end + 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}" + raise Puppet::Error, "Could not find version #{version} of #{name}" else raise Puppet::Error, "Could not find Puppet Face #{name.inspect}" end |