summaryrefslogtreecommitdiffstats
path: root/lib/puppet/file_serving
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-08-18 15:58:38 -0700
committerLuke Kanies <luke@madstop.com>2009-08-18 15:58:38 -0700
commit796ba5c4ccec117bbc4dec69c670337e70b48634 (patch)
tree549f59c2202da84a3c0d527f4df964bc61c1b6b4 /lib/puppet/file_serving
parent6bd3627d606cde4bea9293b855be0dd2b1170a92 (diff)
downloadpuppet-796ba5c4ccec117bbc4dec69c670337e70b48634.tar.gz
puppet-796ba5c4ccec117bbc4dec69c670337e70b48634.tar.xz
puppet-796ba5c4ccec117bbc4dec69c670337e70b48634.zip
Fixing #1544 - plugins in modules now works again
We had to fix the fileserving plumbing to use the request environment instead of trying to use the node environment. This was apparently never fixed after we added the environment to the URI in REST calls. There's still a bit of refactoring left to clean up the APIs used in some of this code. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/file_serving')
-rw-r--r--lib/puppet/file_serving/mount.rb9
-rw-r--r--lib/puppet/file_serving/mount/plugins.rb8
2 files changed, 4 insertions, 13 deletions
diff --git a/lib/puppet/file_serving/mount.rb b/lib/puppet/file_serving/mount.rb
index 5ab6d8688..7ee11a99b 100644
--- a/lib/puppet/file_serving/mount.rb
+++ b/lib/puppet/file_serving/mount.rb
@@ -16,15 +16,6 @@ class Puppet::FileServing::Mount < Puppet::Network::AuthStore
attr_reader :name
- # Determine the environment to use, if any.
- def environment(node_name)
- if node_name and node = Puppet::Node.find(node_name)
- Puppet::Node::Environment.new(node.environment)
- else
- Puppet::Node::Environment.new
- end
- end
-
def find(path, options)
raise NotImplementedError
end
diff --git a/lib/puppet/file_serving/mount/plugins.rb b/lib/puppet/file_serving/mount/plugins.rb
index c7a3ee6ff..02b838c84 100644
--- a/lib/puppet/file_serving/mount/plugins.rb
+++ b/lib/puppet/file_serving/mount/plugins.rb
@@ -5,18 +5,18 @@ require 'puppet/file_serving/mount'
# many directories into one.
class Puppet::FileServing::Mount::Plugins < Puppet::FileServing::Mount
# Return an instance of the appropriate class.
- def find(relative_path, options = {})
- return nil unless mod = environment(options[:node]).modules.find { |mod| mod.plugin(relative_path) }
+ def find(relative_path, environment)
+ return nil unless mod = environment.modules.find { |mod| mod.plugin(relative_path) }
path = mod.plugin(relative_path)
return path
end
- def search(relative_path, options = {})
+ def search(relative_path, environment)
# We currently only support one kind of search on plugins - return
# them all.
- paths = environment(options[:node]).modules.find_all { |mod| mod.plugins? }.collect { |mod| mod.plugin_directory }
+ paths = environment.modules.find_all { |mod| mod.plugins? }.collect { |mod| mod.plugin_directory }
return nil if paths.empty?
return paths
end