From ffd825615b7c4b24bbd40cc0ab1f959fdbc8add0 Mon Sep 17 00:00:00 2001 From: Pete Higgins Date: Mon, 18 May 2020 15:56:36 -0700 Subject: Fix ruby 2.7 keyword argument warnings. Signed-off-by: Pete Higgins --- lib/chef/resource/hostname.rb | 2 +- spec/support/shared/functional/windows_script.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/chef/resource/hostname.rb b/lib/chef/resource/hostname.rb index 9d4dd03aa7..41dc80d1bf 100644 --- a/lib/chef/resource/hostname.rb +++ b/lib/chef/resource/hostname.rb @@ -149,7 +149,7 @@ class Chef # this must come before other methods like /etc/hostname and /etc/sysconfig/network declare_resource(:execute, "hostnamectl set-hostname #{new_resource.hostname}") do notifies :reload, "ohai[reload hostname]" - not_if { shell_out!("hostnamectl status", { returns: [0, 1] }).stdout =~ /Static hostname:\s*#{new_resource.hostname}\s*$/ } + not_if { shell_out!("hostnamectl status", returns: [0, 1]).stdout =~ /Static hostname:\s*#{new_resource.hostname}\s*$/ } end when ::File.exist?("/etc/hostname") # debian family uses /etc/hostname diff --git a/spec/support/shared/functional/windows_script.rb b/spec/support/shared/functional/windows_script.rb index fa3416eed4..7747524d03 100644 --- a/spec/support/shared/functional/windows_script.rb +++ b/spec/support/shared/functional/windows_script.rb @@ -146,7 +146,7 @@ shared_context Chef::Resource::WindowsScript do shared_examples_for "a script whose file system location cannot be accessed by other non-admin users" do let(:ruby_access_command) { file_access_command } it "generates a script in the local file system that prevents read access to other non-admin users" do - shell_out!(access_command, { user: windows_nonadmin_user, password: windows_nonadmin_user_password, returns: [access_denied_sentinel] }) + shell_out!(access_command, user: windows_nonadmin_user, password: windows_nonadmin_user_password, returns: [access_denied_sentinel]) end end -- cgit v1.2.1