diff --git a/acceptance/tests/custom_facts/execution_execute_sets_status_env_variable.rb b/acceptance/tests/custom_facts/execution_execute_sets_status_env_variable.rb index c89c5d58c..271589252 100644 --- a/acceptance/tests/custom_facts/execution_execute_sets_status_env_variable.rb +++ b/acceptance/tests/custom_facts/execution_execute_sets_status_env_variable.rb @@ -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 diff --git a/lib/facter/custom_facts/core/execution.rb b/lib/facter/custom_facts/core/execution.rb index 9c61b460c..4dfb9c993 100644 --- a/lib/facter/custom_facts/core/execution.rb +++ b/lib/facter/custom_facts/core/execution.rb @@ -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 diff --git a/lib/facter/custom_facts/util/resolution.rb b/lib/facter/custom_facts/util/resolution.rb index dfb410ca7..fac161224 100644 --- a/lib/facter/custom_facts/util/resolution.rb +++ b/lib/facter/custom_facts/util/resolution.rb @@ -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 diff --git a/spec/custom_facts/core/execution_spec.rb b/spec/custom_facts/core/execution_spec.rb index 4f18df89d..66ad1117f 100644 --- a/spec/custom_facts/core/execution_spec.rb +++ b/spec/custom_facts/core/execution_spec.rb @@ -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')