specinfra 2.36.8 → 2.36.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cf93ab042236297cb6f78d012341b8b7870b77b
|
4
|
+
data.tar.gz: a81e8e5dbe0c3dfa2bf40d8ddedb32e70bee665e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e01bc129cfeddfc571083a30458bc450795d942f035ad6da3832be25f5952cd15b3d5329c883e577f6f4ddf731e738b80aa5b0bb73374346f598d6542bde135
|
7
|
+
data.tar.gz: 552564670bf16631c158af9b03459a2db6659aab024db502b1f62b32eef7681f4e93df0cbe5eddc6b4e7c62c0feca5e078bf790a3472709ddd5a1ae16896d20b
|
@@ -3,15 +3,8 @@ module Specinfra
|
|
3
3
|
module Module
|
4
4
|
module Service
|
5
5
|
module Systemd
|
6
|
-
def check_is_enabled_under_systemd(service, level=
|
7
|
-
|
8
|
-
level = "runlevel#{level}.target"
|
9
|
-
end
|
10
|
-
unless service.match(/\.(service|mount|device|socket)$/)
|
11
|
-
service += '.service'
|
12
|
-
end
|
13
|
-
|
14
|
-
"systemctl --plain list-dependencies #{level} | grep '\\(^\\| \\)#{escape(service)}$'"
|
6
|
+
def check_is_enabled_under_systemd(service, level=nil)
|
7
|
+
"systemctl --quiet is-enabled #{escape(service)}"
|
15
8
|
end
|
16
9
|
|
17
10
|
def check_is_running_under_systemd(service)
|
data/lib/specinfra/version.rb
CHANGED
@@ -5,7 +5,7 @@ describe Specinfra::Command::Module::Service::Systemd do
|
|
5
5
|
extend Specinfra::Command::Module::Service::Systemd
|
6
6
|
end
|
7
7
|
let(:klass) { Specinfra::Command::Module::Service::Systemd::Test }
|
8
|
-
it { expect(klass.check_is_enabled_under_systemd('httpd')).to eq "systemctl --
|
8
|
+
it { expect(klass.check_is_enabled_under_systemd('httpd')).to eq "systemctl --quiet is-enabled httpd" }
|
9
9
|
it { expect(klass.check_is_running_under_systemd('httpd')).to eq 'systemctl is-active httpd' }
|
10
10
|
it { expect(klass.enable_under_systemd('httpd')).to eq 'systemctl enable httpd' }
|
11
11
|
it { expect(klass.disable_under_systemd('httpd')).to eq 'systemctl disable httpd' }
|
@@ -2,11 +2,11 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Specinfra::Command::Redhat::V7::Service do
|
4
4
|
let(:klass) { Specinfra::Command::Redhat::V7::Service }
|
5
|
-
it { expect(klass.check_is_enabled('httpd')).to eq "systemctl --
|
6
|
-
it { expect(klass.check_is_enabled('httpd', 'multi-user.target')).to eq "systemctl --
|
7
|
-
it { expect(klass.check_is_enabled('httpd'
|
8
|
-
it { expect(klass.check_is_enabled('
|
9
|
-
it { expect(klass.check_is_enabled('
|
5
|
+
it { expect(klass.check_is_enabled('httpd')).to eq "systemctl --quiet is-enabled httpd" }
|
6
|
+
it { expect(klass.check_is_enabled('httpd', 'multi-user.target')).to eq "systemctl --quiet is-enabled httpd" }
|
7
|
+
it { expect(klass.check_is_enabled('httpd.service')).to eq "systemctl --quiet is-enabled httpd.service" }
|
8
|
+
it { expect(klass.check_is_enabled('sshd.socket')).to eq "systemctl --quiet is-enabled sshd.socket" }
|
9
|
+
it { expect(klass.check_is_enabled('logrotate.timer')).to eq "systemctl --quiet is-enabled logrotate.timer" }
|
10
10
|
end
|
11
11
|
|
12
12
|
|