class Object
Public Instance Methods
get_address_after_token(output, token, return_first=false)
click to toggle source
# File lib/facter/ipaddress6.rb, line 26 def get_address_after_token(output, token, return_first=false) ip = nil String(output).scan(/#{token}\s?((?>[0-9,a-f,A-F]*\:{1,2})+[0-9,a-f,A-F]{0,4})/).each do |match| match = match.first unless match =~ /^fe80.*/ or match == "::1" ip = match break if return_first end end ip end
os()
click to toggle source
# File lib/facter/os.rb, line 61 def os @os ||= Facter::Operatingsystem.implementation end
selinux_mount_point()
click to toggle source
This supports the fact that the selinux mount point is not always in the same location – the selinux mount point is operating system specific.
# File lib/facter/selinux.rb, line 69 def selinux_mount_point path = "/selinux" if FileTest.exists?('/proc/self/mounts') # Centos 5 shows an error in which having ruby use File.read to read # /proc/self/mounts combined with the puppet agent run with --listen causes # a hang. Reading from other parts of /proc does not seem to cause this problem. # The work around is to read the file in another process. # -- andy Fri Aug 31 2012 selinux_line = Facter::Core::Execution.exec('cat /proc/self/mounts').each_line.find { |line| line =~ /selinuxfs/ } if selinux_line path = selinux_line.split[1] end end path end