From 7cf05de74a246804bd4e1090798a2e6d0e7881c4 Mon Sep 17 00:00:00 2001 From: Mihmet Akpinar Date: Wed, 5 Jun 2024 09:04:22 +0200 Subject: [PATCH] fix rubocop linting --- lib/facter/vault_version.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/facter/vault_version.rb b/lib/facter/vault_version.rb index b2af286..d1ac06d 100644 --- a/lib/facter/vault_version.rb +++ b/lib/facter/vault_version.rb @@ -5,11 +5,11 @@ # Purpose: Retrieve vault version if installed # 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&.captures.first - end + 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&.captures&.first end + end end