Use new Ruby hash initializer syntax
This commit is contained in:
parent
f18a397289
commit
30b0399431
|
@ -57,12 +57,12 @@ module VagrantPlugins
|
||||||
return 0 if command.empty?
|
return 0 if command.empty?
|
||||||
|
|
||||||
opts = {
|
opts = {
|
||||||
:error_check => true,
|
error_check: true,
|
||||||
:error_class => Errors::ExecutionError,
|
error_class: Errors::ExecutionError,
|
||||||
:error_key => :execution_error,
|
error_key: :execution_error,
|
||||||
:command => command,
|
command: command,
|
||||||
:shell => :powershell,
|
shell: :powershell,
|
||||||
:elevated => false
|
elevated: false
|
||||||
}.merge(opts || {})
|
}.merge(opts || {})
|
||||||
|
|
||||||
if opts[:elevated]
|
if opts[:elevated]
|
||||||
|
@ -131,7 +131,7 @@ module VagrantPlugins
|
||||||
# The error classes expect the translation key to be _key, but that makes for an ugly
|
# The error classes expect the translation key to be _key, but that makes for an ugly
|
||||||
# configuration parameter, so we set it here from `error_key`
|
# configuration parameter, so we set it here from `error_key`
|
||||||
msg = "Command execution failed with an exit code of #{output[:exitcode]}"
|
msg = "Command execution failed with an exit code of #{output[:exitcode]}"
|
||||||
error_opts = opts.merge(:_key => opts[:error_key], :message => msg)
|
error_opts = opts.merge(_key: opts[:error_key], message: msg)
|
||||||
raise opts[:error_class], error_opts
|
raise opts[:error_class], error_opts
|
||||||
end
|
end
|
||||||
end #WinRM class
|
end #WinRM class
|
||||||
|
|
Loading…
Reference in New Issue