summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/file_serving/terminus_helper.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/puppet/file_serving/terminus_helper.rb b/lib/puppet/file_serving/terminus_helper.rb
index 598a5007a..b51e27297 100644
--- a/lib/puppet/file_serving/terminus_helper.rb
+++ b/lib/puppet/file_serving/terminus_helper.rb
@@ -9,7 +9,16 @@ require 'puppet/file_serving/fileset'
module Puppet::FileServing::TerminusHelper
# Create model instances for all files in a fileset.
def path2instances(request, path)
- args = [:links, :ignore, :recurse].inject({}) { |hash, param| hash[param] = request.options[param] if request.options[param]; hash }
+ args = [:links, :ignore, :recurse].inject({}) do |hash, param|
+ if request.options.include?(param) # use 'include?' so the values can be false
+ hash[param] = request.options[param]
+ elsif request.options.include?(param.to_s)
+ hash[param] = request.options[param.to_s]
+ end
+ hash[param] = true if hash[param] == "true"
+ hash[param] = false if hash[param] == "false"
+ hash
+ end
Puppet::FileServing::Fileset.new(path, args).files.collect do |file|
inst = model.new(path, :relative_path => file)
inst.links = request.options[:links] if request.options[:links]