| Server IP : 77.68.64.21 / Your IP : 216.73.217.59 Web Server : Apache System : Linux hp3-wp-1011352.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 : csh2516497 ( 2094697) PHP Version : 8.3.30 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/provider/ |
Upload File : |
# A command that can be executed on the system
class Puppet::Provider::Command
attr_reader :executable
attr_reader :name
# @param [String] name A way of referencing the name
# @param [String] executable The path to the executable file
# @param resolver An object for resolving the executable to an absolute path (usually Puppet::Util)
# @param executor An object for performing the actual execution of the command (usually Puppet::Util::Execution)
# @param [Hash] options Extra options to be used when executing (see Puppet::Util::Execution#execute)
def initialize(name, executable, resolver, executor, options = {})
@name = name
@executable = executable
@resolver = resolver
@executor = executor
@options = options
end
# @param args [Array<String>] Any command line arguments to pass to the executable
# @return The output from the command
def execute(*args)
resolved_executable = @resolver.which(@executable) or raise Puppet::Error, "Command #{@name} is missing"
@executor.execute([resolved_executable] + args, @options)
end
end