diff --git a/lib/facter/vault_version.rb b/lib/facter/vault_version.rb index f65de5b..b2af286 100644 --- a/lib/facter/vault_version.rb +++ b/lib/facter/vault_version.rb @@ -6,11 +6,10 @@ # Facter.add(:vault_version) do setcode do - if Facter::Util::Resolution.which('vault') - vault_server_version_output = Facter::Util::Resolution.exec('vault version') - match = vault_server_version_output.match(%r{Vault v(\d+\.\d+\.\d+)}) - match ? match.captures.first : nil - end + if Facter::Util::Resolution.which('vault') + vault_server_version_output = Facter::Util::Resolution.exec('vault version') + match = vault_server_version_output.match(%r{Vault v(\d+\.\d+\.\d+)}) + match&.captures.first + end end - end - \ No newline at end of file +end