diff options
author | Julien Pivotto <roidelapluie@inuits.eu> | 2016-02-19 09:14:51 +0100 |
---|---|---|
committer | Julien Pivotto <roidelapluie@inuits.eu> | 2016-02-19 09:14:51 +0100 |
commit | b19ae68789e2a7abe0368d710f5860eef2a70a1d (patch) | |
tree | fda523af240fe620effb4d824a4a46fb77ea11a5 | |
parent | e2ef15480abaf5a10404ec4c2c049d82aae47b68 (diff) |
Simplify systemd facts following puppetlabs/facter#871 comments
-rw-r--r-- | lib/facter/systemd.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/facter/systemd.rb b/lib/facter/systemd.rb index 3ac0a1e..b4b11fb 100644 --- a/lib/facter/systemd.rb +++ b/lib/facter/systemd.rb @@ -23,17 +23,13 @@ Facter.add(:systemd) do confine :kernel => :linux setcode do - result = false - init_process_name = Facter::Core::Execution.exec('ps -p 1 -o comm=') - if init_process_name.eql? 'systemd' - result = true - end + Facter::Core::Execution.exec('ps -p 1 -o comm=') == 'systemd' end end Facter.add(:systemd_version) do confine :systemd => true setcode do - version = Facter::Core::Execution.exec("systemctl --version | grep 'systemd' | awk '{ print $2 }'") + Facter::Core::Execution.exec("systemctl --version | grep 'systemd' | awk '{ print $2 }'") end end |