diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-05-17 23:34:48 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-05-17 23:34:48 -0700 |
commit | 97e20b05c4b4b4e63518bc79a4d5d0b267f21f99 (patch) | |
tree | dc12c8c67643bd1a697445863b755121d9975f9a | |
parent | 44b62029f97cbeacb9d6a99a2d6da18097e3108b (diff) | |
download | chef-97e20b05c4b4b4e63518bc79a4d5d0b267f21f99.tar.gz |
Resolve 2 more ruby 2.7 warnings from shell_outwarnings
I believe this is the last of these from shell_out.
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/chef/resource/hostname.rb | 2 | ||||
-rw-r--r-- | 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..3ca215bf6f 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..42ebe4e63f 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 |