From 2a03f669fa4a31d41c4da927104ff5c495280366 Mon Sep 17 00:00:00 2001 From: Kristin Kuche Date: Mon, 25 Mar 2019 13:15:35 +0100 Subject: [PATCH] Fix facts for python rc version --- lib/facter/python_release.rb | 2 +- lib/facter/python_version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/facter/python_release.rb b/lib/facter/python_release.rb index 5013b5c3..6255a839 100644 --- a/lib/facter/python_release.rb +++ b/lib/facter/python_release.rb @@ -2,7 +2,7 @@ def get_python_release(executable) if Facter::Util::Resolution.which(executable) # rubocop:disable Style/GuardClause - results = Facter::Util::Resolution.exec("#{executable} -V 2>&1").match(%r{^.*(\d+\.\d+)\.\d+\+?$}) + results = Facter::Util::Resolution.exec("#{executable} -V 2>&1").match(%r{^.*(\d+\.\d+)\.\d+\+?(?:rc\d+)?$}) results[1] if results end end diff --git a/lib/facter/python_version.rb b/lib/facter/python_version.rb index e21723bb..0f1cf8ac 100644 --- a/lib/facter/python_version.rb +++ b/lib/facter/python_version.rb @@ -2,7 +2,7 @@ def get_python_version(executable) if Facter::Util::Resolution.which(executable) # rubocop:disable Style/GuardClause - results = Facter::Util::Resolution.exec("#{executable} -V 2>&1").match(%r{^.*(\d+\.\d+\.\d+\+?)$}) + results = Facter::Util::Resolution.exec("#{executable} -V 2>&1").match(%r{^.*(\d+\.\d+\.\d+\+?(?:rc\d+)?)$}) results[1] if results end end