summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/facter/shorewall_major_version.rb3
-rw-r--r--lib/facter/shorewall_version.rb3
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/facter/shorewall_major_version.rb b/lib/facter/shorewall_major_version.rb
index 0068b48..9b4c9a2 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
+ confine :shorewall_version => /\d/
setcode do
- Facter::Util::Resolution.exec('shorewall version').split('.').first || nil
+ Facter.value(:shorewall_version).split('.').first
end
end
diff --git a/lib/facter/shorewall_version.rb b/lib/facter/shorewall_version.rb
new file mode 100644
index 0000000..3c1cc67
--- /dev/null
+++ b/lib/facter/shorewall_version.rb
@@ -0,0 +1,3 @@
+Facter.add("shorewall_version") do
+ setcode 'shorewall version'
+end