summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/provider/systemd_unit.rb8
-rw-r--r--spec/unit/provider/systemd_unit_spec.rb3
2 files changed, 1 insertions, 10 deletions
diff --git a/lib/chef/provider/systemd_unit.rb b/lib/chef/provider/systemd_unit.rb
index bba5307453..3ba05e6519 100644
--- a/lib/chef/provider/systemd_unit.rb
+++ b/lib/chef/provider/systemd_unit.rb
@@ -236,13 +236,7 @@ class Chef
def masked?
# Note: masked-runtime is excluded, because runtime is volatile, and
# because masked-runtime is not masked.
- # shell_out to get "masked" stdout.
- shell_out!("systemctl list-unit-files | grep masked").stdout.each_line do |line|
- if line.include?(new_resource.unit_name)
- return %w{bad masked}.include?(systemd_unit_status["UnitFileState"])
- end
- end
- false
+ %w{bad masked}.include?(systemd_unit_status["UnitFileState"])
end
def static?
diff --git a/spec/unit/provider/systemd_unit_spec.rb b/spec/unit/provider/systemd_unit_spec.rb
index faba0e6805..428a897751 100644
--- a/spec/unit/provider/systemd_unit_spec.rb
+++ b/spec/unit/provider/systemd_unit_spec.rb
@@ -929,9 +929,6 @@ describe Chef::Provider::SystemdUnit, :linux_only do
before(:each) do
provider.current_resource = current_resource
allow(provider).to receive(:which).with("systemctl").and_return(systemctl_path.to_s)
- allow(provider).to receive(:shell_out_compacted!).with("systemctl list-unit-files | grep masked").and_return(
- double(stdout: "sysstat-collect\\x2d.timer masked")
- )
end
masked_and_inactive = <<-STDOUT