diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/facter/pe_version.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/facter/pe_version.rb b/lib/facter/pe_version.rb index 0cc0f64..c9f2181 100644 --- a/lib/facter/pe_version.rb +++ b/lib/facter/pe_version.rb @@ -10,8 +10,13 @@ # Facter.add("pe_version") do setcode do - pe_ver = Facter.value("puppetversion").match(/Puppet Enterprise (\d+\.\d+\.\d+)/) - pe_ver[1] if pe_ver + puppet_ver = Facter.value("puppetversion") + if puppet_ver != nil + pe_ver = puppet_ver.match(/Puppet Enterprise (\d+\.\d+\.\d+)/) + pe_ver[1] if pe_ver + else + nil + end end end |