Skip to content

Commit

Permalink
(CONT-774) Hashing options for ruby 3
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasAud committed Apr 19, 2023
1 parent 0e488b1 commit 2eb194e
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion lib/puppet/provider/chocolateyconfig/windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def flush
args << '--value' << resource[:value] if property_ensure != :absent

begin
Puppet::Util::Execution.execute([command(:chocolatey), *args], sensitive: true)
Puppet::Util::Execution.execute([command(:chocolatey), *args], { sensitive: true })
rescue Puppet::ExecutionFailure => e
raise Puppet::Error, "An error occurred running choco. Unable to set Chocolateyconfig[#{name}]: #{e}"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/chocolateysource/windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def flush

if property_ensure == :present
begin
Puppet::Util::Execution.execute([command(:chocolatey), 'source', 'enable', '--name', resource[:name]], sensitive: true)
Puppet::Util::Execution.execute([command(:chocolatey), 'source', 'enable', '--name', resource[:name]], { sensitive: true })
rescue Puppet::ExecutionFailure
raise Puppet::Error, "An error occurred running choco. Unable to set Chocolatey source configuration for #{inspect}"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/package/chocolatey.rb
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def self.instances
pins = []
pin_output = nil unless choco_exe
# don't add -r yet, as there is an issue in 0.9.9.9/0.9.9.10 that returns full list plus pins
pin_output = Puppet::Util::Execution.execute([command(:chocolatey), 'pin', 'list'], sensitive: true) if choco_exe
pin_output = Puppet::Util::Execution.execute([command(:chocolatey), 'pin', 'list'], { sensitive: true }) if choco_exe
pin_output&.split("\n")&.each { |pin| pins << pin.split('|')[0] }

execpipe(listcmd) do |process|
Expand Down
6 changes: 3 additions & 3 deletions spec/unit/puppet/provider/chocolateyconfig/windows_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
'config', 'set',
'--name', resource_name,
'--value', resource_value],
sensitive: true)
{ sensitive: true })

resource.flush
end
Expand All @@ -273,7 +273,7 @@
expect(Puppet::Util::Execution).to receive(:execute).with([provider_class.command(:chocolatey),
'config', 'unset',
'--name', resource_name],
sensitive: true)
{ sensitive: true })

resource.flush
end
Expand All @@ -284,7 +284,7 @@
'config', 'set',
'--name', resource_name,
'--value', resource_value],
sensitive: true).and_raise(Puppet::ExecutionFailure, 'Nooooo')
{ sensitive: true }).and_raise(Puppet::ExecutionFailure, 'Nooooo')

expect { resource.flush }.to raise_error(Puppet::Error, %r{Unable to set Chocolateyconfig})
end
Expand Down
Loading

0 comments on commit 2eb194e

Please sign in to comment.