summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2008-02-14 11:24:39 +1100
committerJames Turnbull <james@lovedthanlost.net>2008-02-14 11:24:39 +1100
commit95db7702b162615c04a138c5e3a266f3d1dcf36c (patch)
treedea820d409a2d165f36d58799be4a73ec5934534 /lib
parentc0d72265a37bffbb0becee0c46511db2a1108899 (diff)
parent5ef8a3e6eb81c7367f50c9de3ec10a8301b106d1 (diff)
downloadpuppet-95db7702b162615c04a138c5e3a266f3d1dcf36c.tar.gz
puppet-95db7702b162615c04a138c5e3a266f3d1dcf36c.tar.xz
puppet-95db7702b162615c04a138c5e3a266f3d1dcf36c.zip
Merge branch '0.24.x' of git://reductivelabs.com/puppet into 0.24.x
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/provider/package/portage.rb8
-rw-r--r--lib/puppet/util/autoload.rb10
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/puppet/provider/package/portage.rb b/lib/puppet/provider/package/portage.rb
index 03274a78d..dccfeaf56 100644
--- a/lib/puppet/provider/package/portage.rb
+++ b/lib/puppet/provider/package/portage.rb
@@ -39,7 +39,7 @@ Puppet::Type.type(:package).provide :portage, :parent => Puppet::Provider::Packa
return packages
rescue Puppet::ExecutionFailure => detail
- raise Puppet::PackageError.new(detail)
+ raise Puppet::Error.new(detail)
end
end
@@ -99,14 +99,14 @@ Puppet::Type.type(:package).provide :portage, :parent => Puppet::Provider::Packa
case packages.size
when 0
not_found_value = "%s/%s" % [@resource[:category] ? @resource[:category] : "<unspecified category>", @resource[:name]]
- raise Puppet::PackageError.new("No package found with the specified name [#{not_found_value}]")
+ raise Puppet::Error.new("No package found with the specified name [#{not_found_value}]")
when 1
return packages[0]
else
- raise Puppet::PackageError.new("More than one package with the specified name [#{search_value}], please use the category parameter to disambiguate")
+ raise Puppet::Error.new("More than one package with the specified name [#{search_value}], please use the category parameter to disambiguate")
end
rescue Puppet::ExecutionFailure => detail
- raise Puppet::PackageError.new(detail)
+ raise Puppet::Error.new(detail)
end
end
diff --git a/lib/puppet/util/autoload.rb b/lib/puppet/util/autoload.rb
index a52575522..535d9ef2e 100644
--- a/lib/puppet/util/autoload.rb
+++ b/lib/puppet/util/autoload.rb
@@ -1,6 +1,9 @@
+require 'puppet/util/warnings'
+
# Autoload paths, either based on names or all at once.
class Puppet::Util::Autoload
include Puppet::Util
+ include Puppet::Util::Warnings
@autoloaders = {}
@loaded = []
@@ -109,9 +112,8 @@ class Puppet::Util::Autoload
Dir.glob("#{dir}/*.rb").each do |file|
name = File.basename(file).sub(".rb", '').intern
next if loaded?(name)
- rubypath = File.join(@path, name.to_s)
begin
- Kernel.require rubypath
+ Kernel.require file
loaded(name, file)
rescue => detail
if Puppet[:trace]
@@ -123,8 +125,6 @@ class Puppet::Util::Autoload
end
end
- private
-
# Yield each subdir in turn.
def eachdir
searchpath.each do |dir|
@@ -137,7 +137,7 @@ class Puppet::Util::Autoload
def searchpath
# JJM: Search for optional lib directories in each module bundle.
module_lib_dirs = Puppet[:modulepath].split(":").collect do |d|
- Dir.glob("%s/*/lib" % d).select do |f|
+ Dir.glob("%s/*/{plugins,lib}" % d).select do |f|
FileTest.directory?(f)
end
end.flatten