summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@reductivelabs.com>2010-01-06 16:35:11 -0800
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commit1705366184133ccbf6d77ac8937ce79760f97d00 (patch)
treee18a69cbd7a6e9e29e60a55668eebb5afc8778fa
parent7bef2e0107451310bc8674134ee28168a4bdfe5d (diff)
downloadpuppet-1705366184133ccbf6d77ac8937ce79760f97d00.tar.gz
puppet-1705366184133ccbf6d77ac8937ce79760f97d00.tar.xz
puppet-1705366184133ccbf6d77ac8937ce79760f97d00.zip
Always warning if autoloading a file fails
This stops hiding some really difficult to track down problems. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
-rw-r--r--lib/puppet/util/autoload.rb16
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/puppet/util/autoload.rb b/lib/puppet/util/autoload.rb
index ceaabe46a..7358618f9 100644
--- a/lib/puppet/util/autoload.rb
+++ b/lib/puppet/util/autoload.rb
@@ -89,14 +89,8 @@ class Puppet::Util::Autoload
rescue SystemExit,NoMemoryError
raise
rescue Exception => detail
- # I have no idea what's going on here, but different versions
- # of ruby are raising different errors on missing files.
- unless detail.to_s =~ /^no such file/i
- warn "Could not autoload %s: %s" % [name, detail]
- if Puppet[:trace]
- puts detail.backtrace
- end
- end
+ puts detail.backtrace if Puppet[:trace]
+ warn "Could not autoload #{name}: #{detail}"
return named_file_is_missing(name)
end
end
@@ -128,10 +122,8 @@ class Puppet::Util::Autoload
rescue SystemExit,NoMemoryError
raise
rescue Exception => detail
- if Puppet[:trace]
- puts detail.backtrace
- end
- warn "Could not autoload %s: %s" % [file.inspect, detail]
+ puts detail.backtrace if Puppet[:trace]
+ warn "Could not autoload #{file}: #{detail}"
end
end
end