| Server IP : 77.68.64.21 / Your IP : 216.73.217.105 Web Server : Apache System : Linux hp3-wp-1011378.hostingp3.local 3.10.0-1160.144.1.el7.tuxcare.els9.x86_64 #1 SMP Fri Jul 10 17:06:31 UTC 2026 x86_64 User : csh2668128 ( 2112425) PHP Version : 8.1.34 Disable Function : shell_exec,exec,system,popen,set_time_limit MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/ruby/vendor_ruby/puppet/file_serving/ |
Upload File : |
require 'puppet/indirector'
require 'puppet/file_serving'
require 'puppet/file_serving/base'
# A class that handles retrieving file contents.
# It only reads the file when its content is specifically
# asked for.
class Puppet::FileServing::Content < Puppet::FileServing::Base
extend Puppet::Indirector
indirects :file_content, :terminus_class => :selector
attr_writer :content
def self.supported_formats
[:raw]
end
def self.from_raw(content)
instance = new("/this/is/a/fake/path")
instance.content = content
instance
end
# BF: we used to fetch the file content here, but this is counter-productive
# for puppetmaster streaming of file content. So collect just returns itself
def collect(source_permissions = nil)
return if stat.ftype == "directory"
self
end
# Read the content of our file in.
def content
unless @content
# This stat can raise an exception, too.
raise(ArgumentError, "Cannot read the contents of links unless following links") if stat.ftype == "symlink"
@content = Puppet::FileSystem.binread(full_path)
end
@content
end
def to_raw
File.new(full_path, "rb")
end
end