diff options
-rw-r--r-- | lib/chef/provider/service/systemd.rb | 2 | ||||
-rw-r--r-- | spec/unit/provider/service/systemd_service_spec.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/provider/service/systemd.rb b/lib/chef/provider/service/systemd.rb index 13c2d7b53c..8f785875cc 100644 --- a/lib/chef/provider/service/systemd.rb +++ b/lib/chef/provider/service/systemd.rb @@ -80,7 +80,7 @@ class Chef::Provider::Service::Systemd < Chef::Provider::Service::Simple @systemd_service_status ||= begin # Collect all the status information for a service and returns it at once options, args = get_systemctl_options_args - s = shell_out!(systemctl_path, args, "show", "-p", "UnitFileState", "-p", "ActiveState", new_resource.service_name, options) + s = shell_out!(systemctl_path, args, "show", "-p", "UnitFileState", "-p", "ActiveState", new_resource.service_name, **options) # e.g. /bin/systemctl --system show -p UnitFileState -p ActiveState sshd.service # Returns something like: # ActiveState=active diff --git a/spec/unit/provider/service/systemd_service_spec.rb b/spec/unit/provider/service/systemd_service_spec.rb index ed6e3f989e..4f38ed5465 100644 --- a/spec/unit/provider/service/systemd_service_spec.rb +++ b/spec/unit/provider/service/systemd_service_spec.rb @@ -313,7 +313,7 @@ describe Chef::Provider::Service::Systemd do def with_systemctl_show(systemctl_path, stdout) systemctl_show = [systemctl_path, "--system", "show", "-p", "UnitFileState", "-p", "ActiveState", service_name] - expect(provider).to receive(:shell_out!).with(*systemctl_show, {}).and_return(double(stdout: stdout, exitstatus: 0, error?: false)) + expect(provider).to receive(:shell_out!).with(*systemctl_show).and_return(double(stdout: stdout, exitstatus: 0, error?: false)) end describe "systemd_service_status" do @@ -341,7 +341,7 @@ describe Chef::Provider::Service::Systemd do it "should error if '#{systemctl_path} --system show -p UnitFileState -p ActiveState service_name' returns non 0" do systemctl_show = [systemctl_path, "--system", "show", "-p", "UnitFileState", "-p", "ActiveState", service_name] - allow(provider).to receive(:shell_out!).with(*systemctl_show, {}).and_return(shell_out_failure) + allow(provider).to receive(:shell_out!).with(*systemctl_show).and_return(shell_out_failure) expect { provider.systemd_service_status }.to raise_error(Chef::Exceptions::Service) end end |