aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schmitt <david@schmitt.edv-bus.at>2008-08-11 20:25:27 +0200
committerDavid Schmitt <david@schmitt.edv-bus.at>2008-08-11 20:25:27 +0200
commit0955f631b958effb60a85eb8f6e73797fd3d3aab (patch)
treed2ee7ba7f006a2b655c4d78c135492378df5d347
parent13ae7fbace9434091d5381208f7b25ff8cf3a5c3 (diff)
downloadpuppet-common-0955f631b958effb60a85eb8f6e73797fd3d3aab.tar.gz
puppet-common-0955f631b958effb60a85eb8f6e73797fd3d3aab.tar.bz2
remove netmask.rb which was merged in facter 1.5
-rw-r--r--plugins/facter/netmask.rb47
1 files changed, 0 insertions, 47 deletions
diff --git a/plugins/facter/netmask.rb b/plugins/facter/netmask.rb
deleted file mode 100644
index 3edf2b6..0000000
--- a/plugins/facter/netmask.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-# netmask.rb -- find the netmask of the primary ipaddress
-# Copyright (C) 2007 David Schmitt <david@schmitt.edv-bus.at>
-# Copyright (C) 2007 Mark 'phips' Phillips
-# See LICENSE for the full license granted to you.
-# idea and originial source by Mark 'phips' Phillips
-
-def get_netmask
- netmask = nil;
- ipregex = %r{(\d{1,3}\.){3}\d{1,3}}
-
- ops = nil
- case Facter.kernel
- when 'Linux'
- ops = {
- :ifconfig => '/sbin/ifconfig',
- :regex => %r{\s+ inet\saddr: #{Facter.ipaddress} .*? Mask: (#{ipregex})}x,
- :munge => nil,
- }
- when 'SunOS'
- ops = {
- :ifconfig => '/usr/sbin/ifconfig -a',
- :regex => %r{\s+ inet\s+? #{Facter.ipaddress} \+? mask (\w{8})}x,
- :munge => Proc.new { |mask| mask.scan(/../).collect do |byte| byte.to_i(16) end.join('.') }
- }
- end
-
- %x{#{ops[:ifconfig]}}.split(/\n/).collect do |line|
- matches = line.match(ops[:regex])
- if !matches.nil?
- if ops[:munge].nil?
- netmask = matches[1]
- else
- netmask = ops[:munge].call(matches[1])
- end
- end
- end
- netmask
-end
-
-Facter.add("netmask") do
- confine :kernel => [ :sunos, :linux ]
- setcode do
- get_netmask
- end
-end
-
-