summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-08-02 07:27:16 +0000
committerJames Turnbull <james@lovedthanlost.net>2009-08-02 17:32:15 +1000
commit97274ad976e3584ae850ad91cc886fae1dcdbbc6 (patch)
tree8d47ec0ffad1284dd7d9916b56323a98cabdc4a8 /lib/puppet
parent6fb8bf625fcfa12b085101838813ab7bc4635dae (diff)
downloadpuppet-97274ad976e3584ae850ad91cc886fae1dcdbbc6.tar.gz
puppet-97274ad976e3584ae850ad91cc886fae1dcdbbc6.tar.xz
puppet-97274ad976e3584ae850ad91cc886fae1dcdbbc6.zip
Fixing problems my Feature refactor caused
The problems were that I wasn't propagating return values sufficiently, such that false values didn't travel enough, and the 'name' attribute was necessary in the private method but wasn't actually passed in. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/util/feature.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/puppet/util/feature.rb b/lib/puppet/util/feature.rb
index 102bca778..add1b2691 100644
--- a/lib/puppet/util/feature.rb
+++ b/lib/puppet/util/feature.rb
@@ -67,7 +67,7 @@ class Puppet::Util::Feature
ary = [ary] unless ary.is_a?(Array)
ary.each do |lib|
- load_library(lib)
+ return false unless load_library(lib, name)
end
# We loaded all of the required libraries
@@ -76,7 +76,7 @@ class Puppet::Util::Feature
private
- def load_library(lib)
+ def load_library(lib, name)
unless lib.is_a?(String)
raise ArgumentError, "Libraries must be passed as strings not %s" % lib.class
end
@@ -85,7 +85,8 @@ class Puppet::Util::Feature
require lib
rescue Exception
Puppet.debug "Failed to load library '%s' for feature '%s'" % [lib, name]
- result = false
+ return false
end
+ return true
end
end