Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
content = <<-EOM
Facter.add(:foo) do
setcode do
Facter::Util::Resolution.exec("#{command}")
Facter::Core::Execution.execute("#{command}", on_fail: nil)
"#{command} exited with code: %{status}" % {status: $?.exitstatus}
end
end
Expand Down
13 changes: 0 additions & 13 deletions lib/facter/custom_facts/core/execution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,6 @@ def with_env(values, &block)
@@impl.with_env(values, &block)
end

# Try to execute a command and return the output.
#
# @param command [String] Command to run
#
# @return [String/nil] Output of the program, or nil if the command does
# not exist or could not be executed.
#
# @deprecated Use #{execute} instead
# @api public
def exec(command)
@@impl.execute(command, on_fail: nil)
end

# Execute a command and return the output of that program.
#
# @param command [String] Command to run
Expand Down
9 changes: 0 additions & 9 deletions lib/facter/custom_facts/util/resolution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ class Resolution
extend Facter::Core::Execution

class << self
# Expose command execution methods that were extracted into
# Facter::Core::Execution from Facter::Util::Resolution in Facter 2.0.0 for
# compatibility.
#
# @deprecated
#
# @api public
public :which, :exec

# @api private
public :with_env
end
Expand Down
5 changes: 0 additions & 5 deletions spec/custom_facts/core/execution_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@
execution.expand_command('waffles')
end

it 'delegates #exec to #execute' do
expect(impl).to receive(:execute).with('waffles', { on_fail: nil })
execution.exec('waffles')
end

it 'delegates #execute to the implementation' do
expect(impl).to receive(:execute).with('waffles', {})
execution.execute('waffles')
Expand Down
Loading