summaryrefslogtreecommitdiffstats
path: root/lib/puppet/file_serving
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/file_serving')
-rw-r--r--lib/puppet/file_serving/base.rb8
-rw-r--r--lib/puppet/file_serving/content.rb1
-rw-r--r--lib/puppet/file_serving/terminus_helper.rb2
3 files changed, 3 insertions, 8 deletions
diff --git a/lib/puppet/file_serving/base.rb b/lib/puppet/file_serving/base.rb
index 1cfd0bc4c..94e337b99 100644
--- a/lib/puppet/file_serving/base.rb
+++ b/lib/puppet/file_serving/base.rb
@@ -7,8 +7,6 @@ require 'puppet/file_serving'
# The base class for Content and Metadata; provides common
# functionality like the behaviour around links.
class Puppet::FileServing::Base
- attr_accessor :key
-
# Does our file exist?
def exist?
begin
@@ -21,8 +19,6 @@ class Puppet::FileServing::Base
# Return the full path to our file. Fails if there's no path set.
def full_path
- raise(ArgumentError, "You must set a path to get a file's path") unless self.path
-
if relative_path.nil? or relative_path == ""
path
else
@@ -30,8 +26,8 @@ class Puppet::FileServing::Base
end
end
- def initialize(key, options = {})
- @key = key
+ def initialize(path, options = {})
+ self.path = path
@links = :manage
options.each do |param, value|
diff --git a/lib/puppet/file_serving/content.rb b/lib/puppet/file_serving/content.rb
index 64f000eaa..f13fcaa72 100644
--- a/lib/puppet/file_serving/content.rb
+++ b/lib/puppet/file_serving/content.rb
@@ -25,7 +25,6 @@ class Puppet::FileServing::Content < Puppet::FileServing::Base
# This stat can raise an exception, too.
raise(ArgumentError, "Cannot read the contents of links unless following links") if stat().ftype == "symlink"
- p full_path
@content = ::File.read(full_path())
end
@content
diff --git a/lib/puppet/file_serving/terminus_helper.rb b/lib/puppet/file_serving/terminus_helper.rb
index e5da0e29f..bde0bd389 100644
--- a/lib/puppet/file_serving/terminus_helper.rb
+++ b/lib/puppet/file_serving/terminus_helper.rb
@@ -11,7 +11,7 @@ module Puppet::FileServing::TerminusHelper
def path2instances(request, path)
args = [:links, :ignore, :recurse].inject({}) { |hash, param| hash[param] = request.options[param] if request.options[param]; hash }
Puppet::FileServing::Fileset.new(path, args).files.collect do |file|
- inst = model.new(File.join(request.key, file), :path => path, :relative_path => file)
+ inst = model.new(path, :relative_path => file)
inst.links = request.options[:links] if request.options[:links]
inst
end