diff --git a/lib/facter/virtualenv_version.rb b/lib/facter/virtualenv_version.rb index 5cf2e019..dbaba059 100644 --- a/lib/facter/virtualenv_version.rb +++ b/lib/facter/virtualenv_version.rb @@ -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