summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPeter Souter <petems@users.noreply.github.com>2016-08-24 20:04:10 +0100
committerRaphaƫl Pinson <github+aem1eeshi1@raphink.net>2016-08-24 21:04:10 +0200
commitb2f44d4832a771dde6ebea86f70811de8b4c1f26 (patch)
tree58e09da1b45f94dfc6cea483c4fc22b3aac7d4f4 /lib
parent922ed77e790399d2121285377826c47ada16f0d5 (diff)
Refactor systemd facts (#12)
* Use `Facter::Util::Resolution.exec`, which is backwards compatible with older Facter, calls the same method in modern facter * Adds basic unit testing for facts
Diffstat (limited to 'lib')
-rw-r--r--lib/facter/systemd.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/facter/systemd.rb b/lib/facter/systemd.rb
index d488efb..4361f77 100644
--- a/lib/facter/systemd.rb
+++ b/lib/facter/systemd.rb
@@ -23,13 +23,13 @@
Facter.add(:systemd) do
confine :kernel => :linux
setcode do
- Facter::Core::Execution.exec('ps -p 1 -o comm=') == 'systemd'
+ Facter::Util::Resolution.exec('ps -p 1 -o comm=') == 'systemd'
end
end
Facter.add(:systemd_version) do
confine :systemd => true
setcode do
- Facter::Core::Execution.exec("systemctl --version | awk '/systemd/{ print $2 }'")
+ Facter::Util::Resolution.exec("systemctl --version | awk '/systemd/{ print $2 }'")
end
end