Skip to content

Commit

Permalink
Improve handling of missing output of virtualenv version fact command
Browse files Browse the repository at this point in the history
Partially fixes #527

Signed-off-by: Wiebe Verweij <[email protected]>
  • Loading branch information
wiebe committed Jul 21, 2020
1 parent ce29405 commit 99ab8cc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/facter/virtualenv_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
Facter.add('virtualenv_version') do
setcode do
if Facter::Util::Resolution.which('virtualenv')
Facter::Util::Resolution.exec('virtualenv --version 2>&1').match(%r{(\d+\.\d+\.?\d*).*$})[1]
results = Facter::Util::Resolution.exec('virtualenv --version 2>&1').match(%r{(\d+\.\d+\.?\d*).*$})
results[1] if results
end
end
end

0 comments on commit 99ab8cc

Please sign in to comment.