diff options
-rw-r--r-- | lib/facter/shorewall_major_version.rb | 3 | ||||
-rw-r--r-- | lib/facter/shorewall_version.rb | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/facter/shorewall_major_version.rb b/lib/facter/shorewall_major_version.rb index 0068b48..e247fc4 100644 --- a/lib/facter/shorewall_major_version.rb +++ b/lib/facter/shorewall_major_version.rb @@ -1,5 +1,6 @@ Facter.add("shorewall_major_version") do setcode do - Facter::Util::Resolution.exec('shorewall version').split('.').first || nil + v = Facter.value('shorewall_version') + v.nil? ? nil : v.split('.').first end end diff --git a/lib/facter/shorewall_version.rb b/lib/facter/shorewall_version.rb new file mode 100644 index 0000000..2a28828 --- /dev/null +++ b/lib/facter/shorewall_version.rb @@ -0,0 +1,5 @@ +Facter.add('shorewall_version') do + setcode do + Facter::Util::Resolution.exec('shorewall version') + end +end |