Please review pull request #157: Ticket/1.6.x/11695 facter comment opened by (ssvarma)

Description:

All fact commenting complete in facter/lib/facter. Thanks Daniel for your feedback.

  • Opened: Wed Jan 25 17:23:54 UTC 2012
  • Based on: puppetlabs:master (f16fcfa0945ef8bf2c405a1995aa0d861626ec48)
  • Requested merge: ssvarma:ticket/1.6.x/11695-facterComment (5a01f455939a6592d1742d2c7439514969c34920)

Diff follows:

diff --git a/lib/facter/Cfkey.rb b/lib/facter/Cfkey.rb
index e4e03f0..3b0c959 100644
--- a/lib/facter/Cfkey.rb
+++ b/lib/facter/Cfkey.rb
@@ -1,18 +1,16 @@
 # Fact: Cfkey
+#   (Facts related to cfengine)
 #
-# Purpose: Return the public key(s) for CFengine.
+# Purpose: 
+# 	   Return the public key(s) for CFengine.
 #
 # Resolution:
 #   Tries each file of standard localhost.pub & cfkey.pub locations,
 #   checks if they appear to be a public key, and then join them all together.
 #
-# Caveats:
+## Cfkey.rb 
 #
 
-## Cfkey.rb
-## Facts related to cfengine
-##
-
 Facter.add(:Cfkey) do
   setcode do
     value = nil
diff --git a/lib/facter/application.rb b/lib/facter/application.rb
index 3f0f375..b9a7366 100644
--- a/lib/facter/application.rb
+++ b/lib/facter/application.rb
@@ -1,3 +1,6 @@
+## application.rb
+#
+
 module Facter
   module Application
     def self.run(argv)
diff --git a/lib/facter/architecture.rb b/lib/facter/architecture.rb
index a8ff9a3..e44be46 100644
--- a/lib/facter/architecture.rb
+++ b/lib/facter/architecture.rb
@@ -8,7 +8,7 @@
 #   Gentoo and Debian call "x86_86" "amd64".
 #   Gentoo also calls "i386" "x86".
 #
-# Caveats:
+## architecture.rb
 #
 
 Facter.add(:architecture) do
diff --git a/lib/facter/arp.rb b/lib/facter/arp.rb
index 2c8bde5..189994a 100644
--- a/lib/facter/arp.rb
+++ b/lib/facter/arp.rb
@@ -1,3 +1,20 @@
+# Fact: arp
+#
+# Purpose: 
+# 	   Internal fact used to specity the program to return the arp value.
+#
+# Resolution: 
+# 	   The arp module creates a fact ‘arp’ if and only if the first entry 
+#	   in the arptable is “fe:ff:ff:ff:ff:ff”. The output is IP address 
+#	   mapped against the MAC address of the machine.
+#
+# Caveats: 
+# 	   Internal fact used to specity the program to detect the arp value only on EC2.
+#	   Warning: Fact might in future be deprcated. Refer to ticket #11307.
+#
+## arp.rb
+#
+
 require 'facter/util/ip'
 
 Facter.add(:arp) do
diff --git a/lib/facter/augeasversion.rb b/lib/facter/augeasversion.rb
index b438e13..7088494 100644
--- a/lib/facter/augeasversion.rb
+++ b/lib/facter/augeasversion.rb
@@ -1,6 +1,7 @@
 # Fact: augeasversion
 #
-# Purpose: Report the version of the Augeas library
+# Purpose: 
+#   Report the version of the Augeas library
 #
 # Resolution:
 #   Loads ruby-augeas and reports the value of /augeas/version, the version of
@@ -12,6 +13,8 @@
 #   which may affect support for the Puppet Augeas provider.
 #   Versions prior to 0.3.6 cannot be interrogated for their version.
 #
+## augeasversion.rb
+#
 
 Facter.add(:augeasversion) do
   setcode do
diff --git a/lib/facter/blockdevices.rb b/lib/facter/blockdevices.rb
index 875718e..e97cda8 100644
--- a/lib/facter/blockdevices.rb
+++ b/lib/facter/blockdevices.rb
@@ -9,7 +9,7 @@
 # Caveats:
 #   Only supports Linux 2.6+ at this time, due to the reliance on sysfs
 #
-
+###
 # Fact: blockdevice_<devicename>_vendor
 #
 # Purpose:
@@ -21,7 +21,8 @@
 # Caveats:
 #   Only supports Linux 2.6+ at this time, due to the reliance on sysfs
 #
-
+#
+###
 # Fact: blockdevice_<devicename>_model
 #
 # Purpose:
@@ -33,8 +34,7 @@
 # Caveats:
 #   Only supports Linux 2.6+ at this time, due to the reliance on sysfs
 #
-
-
+###
 # Fact: blockdevices
 #
 # Purpose:
@@ -46,8 +46,10 @@
 # Caveats:
 #   Block devices must have been identified using sysfs information
 #
-
+## blockdevices.rb
+#
 # Author: Jason Gill <[email protected]>
+#
 
 require 'facter'
 
diff --git a/lib/facter/domain.rb b/lib/facter/domain.rb
index 0a6caa0..73c7ee6 100644
--- a/lib/facter/domain.rb
+++ b/lib/facter/domain.rb
@@ -12,12 +12,13 @@
 #   a final resort, the search from that.
 #   Otherwise returns nil.
 #
-#   On Windows uses the win32ole gem and winmgmts to get the DNSDomain value
+#   Windows uses the win32ole gem and winmgmts to get the DNSDomain value
 #   from the Win32 networking stack.
 #
-# Caveats:
+## domain.rb
 #
 
+
 Facter.add(:domain) do
   setcode do
     # Get the domain from various sources; the order of these
diff --git a/lib/facter/ec2.rb b/lib/facter/ec2.rb
index c52f76b..b021029 100644
--- a/lib/facter/ec2.rb
+++ b/lib/facter/ec2.rb
@@ -1,7 +1,28 @@
-# Original fact Tim Dysinger
-# Additional work from KurtBe
-# Additional work for Paul Nasrat
-# Additional work modelled on Ohai EC2 fact
+# Fact: ec2
+#
+# Purpose: 
+#    Passing through metadta and userdata that it detects on EC2.
+#
+# Resolution: 
+#    If EC2 host is true then passes the metadata and userdata. The meta and user data 
+#    is instance-specific, and therefore only accessible to the instance. 
+#    
+#    Metadata is descriptive information about a particular data set, object, or resource, 
+#    including how it is formatted, and when and by whom it was collected.
+#    Each Amazon EC2 instance has associated metadata, as well as user data supplied when 
+#    launching the instance. 
+#    
+#    Userdata is used by cloud-init to pass bootstrapping scripts to instances when they launch.
+#    In the case of cloudformation, the convention is to pass aws credentials in the userdata.
+#    
+#    More details at:
+#    "http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html" 
+# 
+# Caveat: 
+#    Fact only for EC2 
+#
+## ec2.rb
+#
 
 require 'open-uri'
 require 'timeout'
diff --git a/lib/facter/facterversion.rb b/lib/facter/facterversion.rb
index 519d660..661c765 100644
--- a/lib/facter/facterversion.rb
+++ b/lib/facter/facterversion.rb
@@ -1,10 +1,12 @@
 # Fact: facterversion
 #
-# Purpose: returns the version of the facter module.
+# Purpose: 
+#    Returns the version of the facter module.
 #
-# Resolution: Uses the version constant.
+# Resolution: 
+#    Uses the version constant.
 #
-# Caveats:
+## facterversion.rb
 #
 
 Facter.add(:facterversion) do
diff --git a/lib/facter/fqdn.rb b/lib/facter/fqdn.rb
index 68597f3..ef6912f 100644
--- a/lib/facter/fqdn.rb
+++ b/lib/facter/fqdn.rb
@@ -1,12 +1,16 @@
 # Fact: fqdn
 #
-# Purpose: Returns the fully qualified domain name of the host.
+# Purpose: 
+#    Returns the fully qualified domain name of the host.
 #
-# Resolution: Simply joins the hostname fact with the domain name fact.
+# Resolution: 
+#    Simply joins the hostname fact with the domain name fact.
 #
-# Caveats: No attempt is made to check that the two facts are accurate or that
-# the two facts go together. At no point is there any DNS resolution made
-# either.
+# Caveats: 
+#    No attempt is made to check that the two facts are accurate or that the two
+#    facts go together. At no point is there any DNS resolution made either.
+#
+## fqdn.rb
 #
 
 Facter.add(:fqdn) do
diff --git a/lib/facter/hardwareisa.rb b/lib/facter/hardwareisa.rb
index ecd5a19..6f4525b 100644
--- a/lib/facter/hardwareisa.rb
+++ b/lib/facter/hardwareisa.rb
@@ -9,6 +9,8 @@
 # Caveats:
 #   Some linuxes return unknown to uname -p with relative ease.
 #
+## hardwareisa.rb
+#
 
 Facter.add(:hardwareisa) do
   setcode 'uname -p'
diff --git a/lib/facter/hardwaremodel.rb b/lib/facter/hardwaremodel.rb
index 07e7501..5cdf087 100644
--- a/lib/facter/hardwaremodel.rb
+++ b/lib/facter/hardwaremodel.rb
@@ -8,7 +8,7 @@
 #   On AIX uses the parsed "modelname" output of "lsattr -El sys0 -a modelname".
 #   On Windows uses the 'host_cpu' pulled out of Ruby's config.
 #
-# Caveats:
+## hardwaremodel.rb
 #
 
 Facter.add(:hardwaremodel) do
diff --git a/lib/facter/hostname.rb b/lib/facter/hostname.rb
index 2371ec8..c2bc2bb 100644
--- a/lib/facter/hostname.rb
+++ b/lib/facter/hostname.rb
@@ -1,6 +1,7 @@
 # Fact: hostname
 #
-# Purpose: Return the system's short hostname.
+# Purpose: 
+#   Return the system's short hostname.
 #
 # Resolution:
 #   On all system bar Darwin, parses the output of the "hostname" system command
@@ -8,7 +9,7 @@
 #   On Darwin, uses the system configuration util to get the LocalHostName
 #   variable.
 #
-# Caveats:
+## hostname
 #
 
 Facter.add(:hostname, :ldapname => "cn") do
diff --git a/lib/facter/id.rb b/lib/facter/id.rb
index 0d80f98..33ed8a5 100644
--- a/lib/facter/id.rb
+++ b/lib/facter/id.rb
@@ -1,14 +1,15 @@
 # Fact: id
 #
-# Purpose: Internal fact used to specity the program to return the currently
-# running user id.
+# Purpose: 
+#   Internal fact used to specity the program to return the currently
+#   running user id.
 #
 # Resolution:
 #   On all Unixes bar Solaris, just returns "whoami".
 #   On Solaris, parses the output of the "id" command to grab the username, as
 #   Solaris doesn't have the whoami command.
 #
-# Caveats:
+## id.rb
 #
 
 Facter.add(:id) do
diff --git a/lib/facter/interfaces.rb b/lib/facter/interfaces.rb
index d02a4f7..3239789 100644
--- a/lib/facter/interfaces.rb
+++ b/lib/facter/interfaces.rb
@@ -1,24 +1,28 @@
 # Fact: interfaces
 #
-# Purpose:
+# Purpose: 
+#    Get information regarding all primary interfaces available on the machine 
 #
-# Resolution:
-#
-# Caveats:
-#
-
-# interfaces.rb
-# Try to get additional Facts about the machine's network interfaces
+# Resolution: 
+#    Generates facts regarding the information about all the network interfaces -
+#    physical or virtual that are available on the machine (e.g. ipaddress, ipaddress6, 
+#    macaddress and netmask)
 #
+#    The function 'get_all_interface_output' in util/ip.rb is used to get the details for 
+#    each interface's ipaddress, macaddress, netmask:
+#    Linux, OpenBSD, NetBSD, FreeBSD, Darwin, GNU/kFreeBSD, DragonFly use 'ifconfig -a'.
+#    SunOS uses 'ifconfig -a'.
+#    HP-UX uses 'netstat -in | sed -e 1d'
+#    windows uses 'netsh'
+#    
 # Original concept Copyright (C) 2007 psychedelys <[email protected]>
 # Update and *BSD support (C) 2007 James Turnbull <[email protected]>
 #
+## intertaces.rb
+#
 
 require 'facter/util/ip'
 
-# Note that most of this only works on a fixed list of platforms; notably, Darwin
-# is missing.
-
 Facter.add(:interfaces) do
   confine :kernel => Facter::Util::IP.supported_platforms
   setcode do
diff --git a/lib/facter/ipaddress.rb b/lib/facter/ipaddress.rb
index 360becd..59f4798 100644
--- a/lib/facter/ipaddress.rb
+++ b/lib/facter/ipaddress.rb
@@ -1,6 +1,7 @@
 # Fact: ipaddress
 #
-# Purpose: Return the main IP address for a host.
+# Purpose: 
+#   Return the main IP address for a host.
 #
 # Resolution:
 #   On the Unixes does an ifconfig, and returns the first non 127.0.0.0/8
@@ -21,6 +22,8 @@
 #   The ifconfig parsing purely takes the first IP address it finds without any
 #   checking this is a useful IP address.
 #
+## ipaddress.rb
+#
 
 Facter.add(:ipaddress) do
   confine :kernel => :linux
diff --git a/lib/facter/ipaddress6.rb b/lib/facter/ipaddress6.rb
index bcc0aee..364780e 100644
--- a/lib/facter/ipaddress6.rb
+++ b/lib/facter/ipaddress6.rb
@@ -1,6 +1,7 @@
 # Fact: ipaddress6
 #
-# Purpose: Returns the "main" IPv6 IP address of a system.
+# Purpose: 
+#  Returns the "main" IPv6 IP address of a system.
 #
 # Resolution:
 #  OS dependant code that parses the output of various networking
@@ -13,13 +14,12 @@
 #  after the ipaddress fact for the sake of similar functionality
 #  and familiar mechanics.
 #
-# Caveats:
+#  Used the ipaddress fact that is already part of facter as a template.
 #
-
 # Cody Herriges <[email protected]>
 #
-# Used the ipaddress fact that is already part of
-# Facter as a template.
+## ipaddress6.rb
+#
 
 def get_address_after_token(output, token, return_first=false)
   ip = nil
diff --git a/lib/facter/iphostnumber.rb b/lib/facter/iphostnumber.rb
index 2d22017..bb8d599 100644
--- a/lib/facter/iphostnumber.rb
+++ b/lib/facter/iphostnumber.rb
@@ -1,12 +1,13 @@
 # Fact: iphostnumber
 #
-# Purpose: On selected versions of Darwin, returns the host's IP address.
+# Purpose: 
+#   On selected versions of Darwin, returns the host's IP address.
 #
 # Resolution:
 #   Uses either the scutil program to get the localhost name, or parses output
 #   of ifconfig for a MAC address.
 #
-# Caveats:
+## iphostnumber
 #
 
 Facter.add(:iphostnumber) do
diff --git a/lib/facter/kernel.rb b/lib/facter/kernel.rb
index 31ac22d..5f80828 100644
--- a/lib/facter/kernel.rb
+++ b/lib/facter/kernel.rb
@@ -1,12 +1,13 @@
 # Fact: kernel
 #
-# Purpose: Returns the operating system's name.
+# Purpose: 
+#   Returns the operating system's name.
 #
 # Resolution:
 #   Uses Ruby's rbconfig to find host_os, if that is a Windows derivative, the
 #   returns 'windows', otherwise returns "uname -s" verbatim.
 #
-# Caveats:
+## kernel.rb
 #
 
 Facter.add(:kernel) do
diff --git a/lib/facter/kernelmajversion.rb b/lib/facter/kernelmajversion.rb
index f7302d4..b2fbacc 100644
--- a/lib/facter/kernelmajversion.rb
+++ b/lib/facter/kernelmajversion.rb
@@ -1,11 +1,12 @@
 # Fact: kernelmajversion
 #
-# Purpose: Return the operating system's release number's major value.
+# Purpose: 
+#   Return the operating system's release number's major value.
 #
 # Resolution:
 #   Takes the first 2 elements of the kernel version as delimited by periods.
 #
-# Caveats:
+## kernelmajversion.rb
 #
 
 Facter.add("kernelmajversion") do
diff --git a/lib/facter/kernelrelease.rb b/lib/facter/kernelrelease.rb
index a38b128..bc8c305 100644
--- a/lib/facter/kernelrelease.rb
+++ b/lib/facter/kernelrelease.rb
@@ -1,6 +1,7 @@
 # Fact: kernelrelease
 #
-# Purpose: Return the operating system's release number.
+# Purpose: 
+#   Return the operating system's release number.
 #
 # Resolution:
 #   On AIX returns the output from the "oslevel -s" system command.
@@ -8,7 +9,7 @@
 #   for the 'Win32_OperatingSystem' value.
 #   Otherwise uses the output of "uname -r" system command.
 #
-# Caveats:
+## kernelrelease.rb
 #
 
 Facter.add(:kernelrelease) do
diff --git a/lib/facter/kernelversion.rb b/lib/facter/kernelversion.rb
index b8fc34c..a2a3bc2 100644
--- a/lib/facter/kernelversion.rb
+++ b/lib/facter/kernelversion.rb
@@ -1,13 +1,14 @@
 # Fact: kernelversion
 #
-# Purpose: Return the operating system's kernel version.
+# Purpose: 
+#   Return the operating system's kernel version.
 #
 # Resolution:
 #   On Solaris and SunOS based machines, returns the output of "uname -v".
 #   Otherwise returns the 'kernerlversion' fact up to the first '-'. This may be
 #   the entire 'kernelversion' fact in many cases.
 #
-# Caveats:
+## kernelversion.rb
 #
 
 Facter.add("kernelversion") do
diff --git a/lib/facter/lsb.rb b/lib/facter/lsb.rb
index 7cefb5c..89be966 100644
--- a/lib/facter/lsb.rb
+++ b/lib/facter/lsb.rb
@@ -1,6 +1,8 @@
-# Fact: lsb
+# Fact: lsb 
+#   (Facts related to Linux Standard Base (LSB))
 #
-# Purpose: Return Linux Standard Base information for the host.
+# Purpose: 
+#   Return Linux Standard Base information for the host.
 #
 # Resolution:
 #   Uses the lsb_release system command and parses the output with a series of
@@ -10,9 +12,9 @@
 #   Only works on Linux (and the kfreebsd derivative) systems.
 #   Requires the lsb_release program, which may not be installed by default.
 #   Also is as only as accurate as that program outputs.
-
+#
 ## lsb.rb
-## Facts related to Linux Standard Base (LSB)
+#
 
 {  "LSBRelease"         => %r{^LSB Version:\t(.*)$},
    "LSBDistId"          => %r{^Distributor ID:\t(.*)$},
diff --git a/lib/facter/lsbmajdistrelease.rb b/lib/facter/lsbmajdistrelease.rb
index a40441a..ba63274 100644
--- a/lib/facter/lsbmajdistrelease.rb
+++ b/lib/facter/lsbmajdistrelease.rb
@@ -1,17 +1,18 @@
 # Fact: lsbmajdistrelease
 #
-# Purpose: Returns the major version of the operation system version as gleaned
-# from the lsbdistrelease fact.
+# Purpose: 
+#   Returns the major version of the operation system version as gleaned
+#   from the lsbdistrelease fact.
 #
 # Resolution:
 #   Parses the lsbdistrelease fact for numbers followed by a period and
 #   returns those, or just the lsbdistrelease fact if none were found.
 #
-# Caveats:
-#
-
 # lsbmajdistrelease.rb
 #
+## lsbmajdistrelease.rb
+#
+
 require 'facter'
 
 Facter.add("lsbmajdistrelease") do
diff --git a/lib/facter/macaddress.rb b/lib/facter/macaddress.rb
index 6af30aa..1735d88 100644
--- a/lib/facter/macaddress.rb
+++ b/lib/facter/macaddress.rb
@@ -1,10 +1,16 @@
 # Fact: macaddress
 #
-# Purpose:
+# Purpose: 
+#   Generate the mac address.
 #
-# Resolution:
+# Resolution: 
+#   Solaris uses 'netstat -np' to generate the fact.
+#   SunOS, Linux, GNU/kFreeBSD use 'ifconfig -a'. 
+#   FreeBSD, OpenBSD, DragonFly use 'ifconfig'.
+#   Darwin and Windows use functions in util/macaddress.rb, Darwin uses 'ifconfig' or 'netstat'.  
+#   AIX uses 'ifconfig -a' or 'entstat'
 #
-# Caveats:
+## macaddress.rb
 #
 
 require 'facter/util/macaddress'
diff --git a/lib/facter/macosx.rb b/lib/facter/macosx.rb
index 74a0cc7..7496ce0 100644
--- a/lib/facter/macosx.rb
+++ b/lib/facter/macosx.rb
@@ -8,12 +8,8 @@
 #   Uses util/macosx.rb to do the fact reconnaissance, then outputs them
 #   preceded by 'sp_'
 #
-# Caveats:
-#
-
-#
 # macosx.rb
-# Additional Facts coming from Mac OS X system_profiler command
+#   Additional Facts coming from Mac OS X system_profiler command
 #
 # Copyright (C) 2007 Jeff McCune
 # Author: Jeff McCune <[email protected]>
@@ -23,6 +19,9 @@
 # We could add quite a bit more, but I didn't want to overload facter
 # at this point in time.
 # In particular, Installed Software might be an interesting addition.
+#
+## macos.rb
+#
 
 require 'facter/util/macosx'
 
diff --git a/lib/facter/manufacturer.rb b/lib/facter/manufacturer.rb
index 7fe75e6..d2f1247 100644
--- a/lib/facter/manufacturer.rb
+++ b/lib/facter/manufacturer.rb
@@ -1,6 +1,7 @@
 # Fact: manufacturer
 #
-# Purpose: Return the hardware manufacturer information about the hardware.
+# Purpose: 
+#   Return the hardware manufacturer information about the hardware.
 #
 # Resolution:
 #   On OpenBSD, queries sysctl values, via a util class.
@@ -8,12 +9,10 @@
 #   On Windows, queries the system via a util class.
 #   Uses the 'util/manufacturer.rb' for fallback parsing.
 #
-# Caveats:
-#
-
 # manufacturer.rb
 # Facts related to hardware manufacturer
 #
+## manufacturer.rb
 #
 
 require 'facter/util/manufacturer'
diff --git a/lib/facter/memory.rb b/lib/facter/memory.rb
index 0b7731f..88bed8f 100644
--- a/lib/facter/memory.rb
+++ b/lib/facter/memory.rb
@@ -1,6 +1,7 @@
 # Fact: memory
 #
-# Purpose: Return information about memory and swap usage.
+# Purpose: 
+#   Return information about memory and swap usage.
 #
 # Resolution:
 #   On Linuxes, uses Facter::Memory.meminfo_number from
@@ -14,14 +15,15 @@
 # Caveats:
 #   Some BSD platforms aren't covered at all. AIX is missing memory values.
 #
-
 # memory.rb
 # Additional Facts for memory/swap usage
 #
 # Copyright (C) 2006 Mooter Media Ltd
 # Author: Matthew Palmer <[email protected]>
 #
+## memory.rb
 #
+
 require 'facter/util/memory'
 
 {   :MemorySize => "MemTotal",
diff --git a/lib/facter/netmask.rb b/lib/facter/netmask.rb
index 710ebe4..75563a5 100644
--- a/lib/facter/netmask.rb
+++ b/lib/facter/netmask.rb
@@ -1,18 +1,19 @@
 # Fact: netmask
 #
-# Purpose: Returns the netmask for the main interfaces.
+# Purpose: 
+#   Find and return the netmask for the primary interfaces.
 #
-# Resolution: Uses the facter/util/netmask library routines.
+# Resolution: 
+#   Uses the facter/util/netmask library routines.
 #
-# Caveats:
-#
-# netmask.rb
-# Find the netmask of the primary ipaddress
 # Copyright (C) 2007 David Schmitt <[email protected]>
 # Copyright (C) 2007 Mark 'phips' Phillips
 #
 # idea and originial source by Mark 'phips' Phillips
 #
+## netmask.rb
+#
+
 require 'facter/util/netmask'
 
 Facter.add("netmask") do
diff --git a/lib/facter/network.rb b/lib/facter/network.rb
index 390895a..8e0ebc4 100644
--- a/lib/facter/network.rb
+++ b/lib/facter/network.rb
@@ -1,14 +1,14 @@
 # Fact: network
 #
 # Purpose:
-# Get IP, network and netmask information for available network
-# interfacs.
+#    Get IP, network and netmask information for available network interfacs.
 #
 # Resolution:
-#  Uses 'facter/util/ip' to enumerate interfaces and return their information.
+#    Uses 'facter/util/ip' to enumerate interfaces and return their information.
 #
-# Caveats:
+## network.rb
 #
+
 require 'facter/util/ip'
 
 Facter::Util::IP.get_interfaces.each do |interface|
diff --git a/lib/facter/operatingsystem.rb b/lib/facter/operatingsystem.rb
index c84cc0f..23eaae0 100644
--- a/lib/facter/operatingsystem.rb
+++ b/lib/facter/operatingsystem.rb
@@ -1,6 +1,7 @@
 # Fact: operatingsystem
 #
-# Purpose: Return the name of the operating system.
+# Purpose: 
+#   Return the name of the operating system.
 #
 # Resolution:
 #   If the kernel is a Linux kernel, check for the existence of a selection of
@@ -8,8 +9,9 @@
 #   On SunOS based kernels, return Solaris.
 #   On systems other than Linux, use the kernel value.
 #
-# Caveats:
+## operatingsystem.rb
 #
+
 require 'facter/lsb'
 
 Facter.add(:operatingsystem) do
diff --git a/lib/facter/operatingsystemrelease.rb b/lib/facter/operatingsystemrelease.rb
index 28d2519..c5f523a 100644
--- a/lib/facter/operatingsystemrelease.rb
+++ b/lib/facter/operatingsystemrelease.rb
@@ -1,6 +1,7 @@
 # Fact: operatingsystemrelease
 #
-# Purpose: Returns the release of the operating system.
+# Purpose: 
+#   Returns the release of the operating system.
 #
 # Resolution:
 #   On RedHat derivatives, returns their '/etc/<variant>-release' file.
@@ -14,7 +15,7 @@
 #   
 #   On all remaining systems, returns the 'kernelrelease' value.
 #
-# Caveats:
+## operatingsystemrelease.rb
 #
 
 Facter.add(:operatingsystemrelease) do
diff --git a/lib/facter/osfamily.rb b/lib/facter/osfamily.rb
index f3bb81d..c596cb0 100644
--- a/lib/facter/osfamily.rb
+++ b/lib/facter/osfamily.rb
@@ -1,6 +1,7 @@
 # Fact: osfamily
 #
-# Purpose: Returns the operating system
+# Purpose: 
+#   Returns the operating system
 #
 # Resolution:
 #   Maps operating systems to operating system families, such as linux
@@ -11,6 +12,8 @@
 #   This fact is completely reliant on the operatingsystem fact, and no
 #   heuristics are used
 #
+## osfamily.rb
+#
 
 Facter.add(:osfamily) do
 
diff --git a/lib/facter/path.rb b/lib/facter/path.rb
index 5c45a58..429b46b 100644
--- a/lib/facter/path.rb
+++ b/lib/facter/path.rb
@@ -1,10 +1,12 @@
 # Fact: path
 #
-# Purpose: Returns the $PATH variable.
+# Purpose: 
+#   Returns the $PATH variable.
 #
-# Resolution: Gets $PATH from the environment.
+# Resolution: 
+#   Gets $PATH from the environment.
 #
-# Caveats:
+## path.rb
 #
 
 Facter.add(:path) do
diff --git a/lib/facter/physicalprocessorcount.rb b/lib/facter/physicalprocessorcount.rb
index ee9f20d..76052da 100644
--- a/lib/facter/physicalprocessorcount.rb
+++ b/lib/facter/physicalprocessorcount.rb
@@ -1,14 +1,15 @@
 # Fact: physicalprocessorcount
 #
-# Purpose: Return the number of physical processors.
+# Purpose: 
+#   Return the number of physical processors.
 #
 # Resolution:
-#
 #   Attempts to use sysfs to get the physical IDs of the processors. Falls
 #   back to /proc/cpuinfo and "physical id" if sysfs is not available.
 #
-# Caveats:
+## physicalprocessorcount.rb
 #
+
 Facter.add('physicalprocessorcount') do
   confine :kernel => :linux
 
diff --git a/lib/facter/processor.rb b/lib/facter/processor.rb
index b08a029..c8a5d32 100644
--- a/lib/facter/processor.rb
+++ b/lib/facter/processor.rb
@@ -9,14 +9,11 @@
 #   On OpenBSD, use 'uname -p' and the sysctl variable for 'hw.ncpu' for CPU
 #   count.
 #
-# Caveats:
-#
-
-# processor.rb
-#
 # Copyright (C) 2006 Mooter Media Ltd
 # Author: Matthew Palmer <[email protected]>
 #
+## processor.rb
+#
 
 require 'thread'
 require 'facter/util/processor'
diff --git a/lib/facter/ps.rb b/lib/facter/ps.rb
index 5d8cb0a..8c3537b 100644
--- a/lib/facter/ps.rb
+++ b/lib/facter/ps.rb
@@ -1,13 +1,14 @@
 # Fact: ps
 #
-# Purpose: Internal fact for what to use to list all processes. Used by
-# Service{} type in Puppet.
+# Purpose: 
+#   Internal fact for what to use to list all processes. 
+#   Used by Service{} type in Puppet.
 #
 # Resolution:
 #   Assumes "ps -ef" for all operating systems other than BSD derivatives, where
 #   it uses "ps auxwww"
 #
-# Caveats:
+## ps.rb
 #
 
 Facter.add(:ps) do
diff --git a/lib/facter/puppetversion.rb b/lib/facter/puppetversion.rb
index 837a6e8..48de257 100644
--- a/lib/facter/puppetversion.rb
+++ b/lib/facter/puppetversion.rb
@@ -1,11 +1,12 @@
 # Fact: puppetversion
 #
-# Purpose: Return the version of puppet installed.
+# Purpose: 
+#   Return the version of puppet installed.
 #
 # Resolution:
 #   Requres puppet via Ruby and returns it's version constant.
 #
-# Caveats:
+## puppetversion.rb
 #
 
 Facter.add(:puppetversion) do
diff --git a/lib/facter/rubysitedir.rb b/lib/facter/rubysitedir.rb
index 73aa215..68514f4 100644
--- a/lib/facter/rubysitedir.rb
+++ b/lib/facter/rubysitedir.rb
@@ -1,11 +1,13 @@
 # Fact: rubysitedir
 #
-# Purpose: Returns Ruby's site library directory.
+# Purpose: 
+#   Returns Ruby's site library directory.
 #
-# Resolution: Works out the version to major/minor (1.8, 1.9, etc), then joins
-# that with all the $: library paths.
+# Resolution: 
+#   Works out the version to major/minor (1.8, 1.9, etc), 
+#   then joins that with all the $: library paths.
 #
-# Caveats:
+## rubysitedir.rb
 #
 
 Facter.add :rubysitedir do
diff --git a/lib/facter/rubyversion.rb b/lib/facter/rubyversion.rb
index 32bf254..b5cb910 100644
--- a/lib/facter/rubyversion.rb
+++ b/lib/facter/rubyversion.rb
@@ -1,10 +1,12 @@
 # Fact: rubyversion
 #
-# Purpose: Returns the version of Ruby facter is running under.
+# Purpose: 
+#   Returns the version of Ruby facter is running under.
 #
-# Resolution: Returns RUBY_VERSION.
+# Resolution: 
+#   Returns RUBY_VERSION.
 #
-# Caveats:
+## rubyversion.rb
 #
 
 Facter.add(:rubyversion) do
diff --git a/lib/facter/selinux.rb b/lib/facter/selinux.rb
index 36f4b2f..e7868dd 100644
--- a/lib/facter/selinux.rb
+++ b/lib/facter/selinux.rb
@@ -1,14 +1,22 @@
 # Fact: selinux
 #
-# Purpose:
+# Purpose: 
+#   Get SELinux specific facts.
 #
-# Resolution:
+# Resolution: 
+#   Checks to see if system is SElinux capable and if so is it enforced or not 
+#   e.g. turned on or off. Based on that, sets SELinux facts like selinux_policyversion and
+#   selinux_current_mode, selinux_config_mode & selinux_config_policy using sestatus_cmd.
 #
-# Caveats:
+# Caveat:
+#   'selinux_mode' is a legacy fact which returns the old selinux_mode fact value to prevent
+#   breakages of existing manifests. It should be removed at the next major release.
+#   See ticket #6677.
 #
-
-# Fact for SElinux
 # Written by immerda admin team (admin(at)immerda.ch)
+#
+## selinux.rb
+#
 
 sestatus_cmd = '/usr/sbin/sestatus'
 
diff --git a/lib/facter/ssh.rb b/lib/facter/ssh.rb
index 6aa7e08..c60afda 100644
--- a/lib/facter/ssh.rb
+++ b/lib/facter/ssh.rb
@@ -1,15 +1,20 @@
 # Fact: ssh
 #
-# Purpose:
+# Purpose: 
+#   Create facts for the public RSA, DSA, ECDSA host keys for ssh
 #
-# Resolution:
+# Resolution: 
+#   The code looks in 4 directories for the files ssh_host_dsa_key.pub 
+#   and two more, and if those files exists, it creates facter facts called SSHDSAKey,  
+#   SSHRSAKey, SSHECDSAKey - then opens and reads the file (e.g. ssh_host_dsa_key.pub 
+#   by f=File.open(filepath) ), gets rid of blank spaces and then stores the string in 
+#   an array. The first entry in the array is set to a specific facts value.  
 #
-# Caveats:
+#   If trouble in opening file, or reading/parsing the line or if the files don't exist, 
+#   the code sets those facts to nil (the facts are still created with nil value)
 #
-
 ## ssh.rb
-## Facts related to SSH
-##
+#
 
 ["/etc/ssh","/usr/local/etc/ssh","/etc","/usr/local/etc"].each do |dir|
   {"SSHDSAKey" => "ssh_host_dsa_key.pub", "SSHRSAKey" => "ssh_host_rsa_key.pub", "SSHECDSAKey" => "ssh_host_ecdsa_key.pub"}.each do |name,file|
diff --git a/lib/facter/timezone.rb b/lib/facter/timezone.rb
index 246d295..857d332 100644
--- a/lib/facter/timezone.rb
+++ b/lib/facter/timezone.rb
@@ -1,10 +1,12 @@
 # Fact: timezone
 #
-# Purpose: Return the machine's time zone.
+# Purpose: 
+#   Return the machine's time zone.
 #
-# Resolution: Uses's Ruby's Time module's Time.new call.
+# Resolution: 
+#   Uses's Ruby's Time module's Time.new call.
 #
-# Caveats:
+## timezone.rb
 #
 
 Facter.add("timezone") do
diff --git a/lib/facter/uniqueid.rb b/lib/facter/uniqueid.rb
index df2ed87..b65de5c 100644
--- a/lib/facter/uniqueid.rb
+++ b/lib/facter/uniqueid.rb
@@ -1,3 +1,18 @@
+# Fact: uniqueid
+#
+# Purpose: 
+#   Generates a string that should be unique for the host.
+#
+# Resolution: 
+#   Uses 'hostid' to generate it.
+#
+# Caveats: 
+#   Returns a host ID but it is not unique on all platforms e.g. Linux. It is unique 
+#   on Solaris. It is being depricated "http://projects.puppetlabs.com/issues/3926".
+#
+## uniqueid.rb
+#
+
 Facter.add(:uniqueid) do
   setcode 'hostid'
   confine :kernel => %w{SunOS Linux AIX GNU/kFreeBSD}
diff --git a/lib/facter/uptime.rb b/lib/facter/uptime.rb
index 7aeeb39..16f7a5b 100644
--- a/lib/facter/uptime.rb
+++ b/lib/facter/uptime.rb
@@ -1,12 +1,13 @@
 # Fact: uptime
 #
-# Purpose: return the system uptime in a human readable format.
+# Purpose: 
+#   Return the system uptime in a human readable format.
 #
 # Resolution:
 #   Does basic maths on the "uptime_seconds" fact to return a count of
 #   days, hours and minutes of uptime
 #
-# Caveats:
+## uptime.rb
 #
 
 require 'facter/util/uptime'
diff --git a/lib/facter/uptime_days.rb b/lib/facter/uptime_days.rb
index 6bf6270..41c92c0 100644
--- a/lib/facter/uptime_days.rb
+++ b/lib/facter/uptime_days.rb
@@ -1,10 +1,12 @@
 # Fact: uptime_days
 #
-# Purpose: Return purely number of days of uptime.
+# Purpose: 
+#   Return purely number of days of uptime.
 #
-# Resolution: Divides uptime_hours fact by 24.
+# Resolution: 
+#   Divides uptime_hours fact by 24.
 #
-# Caveats:
+## uptime_days.rb
 #
 
 Facter.add(:uptime_days) do
diff --git a/lib/facter/uptime_hours.rb b/lib/facter/uptime_hours.rb
index e780751..a6b7c6b 100644
--- a/lib/facter/uptime_hours.rb
+++ b/lib/facter/uptime_hours.rb
@@ -1,10 +1,12 @@
 # Fact: uptime_hours
 #
-# Purpose: Return purely number of hours of uptime.
+# Purpose: 
+#   Return purely number of hours of uptime.
 #
-# Resolution: Divides uptime_seconds fact by 3600.
+# Resolution: 
+#   Divides uptime_seconds fact by 3600.
 #
-# Caveats:
+## uptime_hours.rb
 #
 
 Facter.add(:uptime_hours) do
diff --git a/lib/facter/uptime_seconds.rb b/lib/facter/uptime_seconds.rb
index 9793e41..c6264a4 100644
--- a/lib/facter/uptime_seconds.rb
+++ b/lib/facter/uptime_seconds.rb
@@ -1,6 +1,7 @@
 # Fact: uptime_seconds
 #
-# Purpose: Return purely number of seconds of uptime.
+# Purpose: 
+#   Return purely number of seconds of uptime.
 #
 # Resolution:
 #   Using the 'facter/util/uptime.rb' module, try a verity of methods to acquire
@@ -9,7 +10,7 @@
 #   On Windows, the module calculates the uptime by the "LastBootupTime" Windows
 #   management value.
 #
-# Caveats:
+## uptime_seconds.rb
 #
 
 require 'facter/util/uptime'
diff --git a/lib/facter/util/config.rb b/lib/facter/util/config.rb
index 1630ead..e17cb90 100644
--- a/lib/facter/util/config.rb
+++ b/lib/facter/util/config.rb
@@ -1,5 +1,3 @@
-# A module to return config related data
-#
 module Facter::Util::Config
   require 'rbconfig'
 
diff --git a/lib/facter/util/confine.rb b/lib/facter/util/confine.rb
index 1f9e11e..9252afd 100644
--- a/lib/facter/util/confine.rb
+++ b/lib/facter/util/confine.rb
@@ -1,6 +1,3 @@
-# A restricting tag for fact resolution mechanisms.  The tag must be true
-# for the resolution mechanism to be suitable.
-
 require 'facter/util/values'
 
 class Facter::Util::Confine
diff --git a/lib/facter/util/ip.rb b/lib/facter/util/ip.rb
index b7395e0..1df292a 100644
--- a/lib/facter/util/ip.rb
+++ b/lib/facter/util/ip.rb
@@ -1,5 +1,3 @@
-# A base module for collecting IP-related
-# information from all kinds of platforms.
 module Facter::Util::IP
   # A map of all the different regexes that work for
   # a given platform or set of platforms.
diff --git a/lib/facter/util/macaddress.rb b/lib/facter/util/macaddress.rb
index 82470ec..9b5af22 100644
--- a/lib/facter/util/macaddress.rb
+++ b/lib/facter/util/macaddress.rb
@@ -1,5 +1,3 @@
-# A module to gather macaddress facts
-#
 module Facter::Util::Macaddress
 
   def self.standardize(macaddress)
diff --git a/lib/facter/util/macosx.rb b/lib/facter/util/macosx.rb
index dffa102..0d6c34d 100644
--- a/lib/facter/util/macosx.rb
+++ b/lib/facter/util/macosx.rb
@@ -1,10 +1,3 @@
-## macosx.rb
-## Support methods for Apple OSX facts
-##
-## Copyright (C) 2007 Jeff McCune
-## Author: Jeff McCune <[email protected]>
-##
-
 module Facter::Util::Macosx
   require 'thread'
   require 'facter/util/plist'
diff --git a/lib/facter/util/manufacturer.rb b/lib/facter/util/manufacturer.rb
index 7542eae..144d721 100644
--- a/lib/facter/util/manufacturer.rb
+++ b/lib/facter/util/manufacturer.rb
@@ -1,6 +1,3 @@
-# mamufacturer.rb
-# Support methods for manufacturer specific facts
-
 module Facter::Manufacturer
 
   def self.get_dmi_table()
diff --git a/lib/facter/util/memory.rb b/lib/facter/util/memory.rb
index 09a8166..2e7c14f 100644
--- a/lib/facter/util/memory.rb
+++ b/lib/facter/util/memory.rb
@@ -1,7 +1,3 @@
-## memory.rb
-## Support module for memory related facts
-##
-
 module Facter::Memory
   require 'thread'
 
diff --git a/lib/facter/virtual.rb b/lib/facter/virtual.rb
index e617359..cb2999a 100644
--- a/lib/facter/virtual.rb
+++ b/lib/facter/virtual.rb
@@ -1,6 +1,7 @@
 # Fact: virtual
 #
-# Purpose: Determine if the system's hardware is real or virtualised.
+# Purpose: 
+#   Determine if the system's hardware is real or virtualised.
 #
 # Resolution:
 #   Assumes physical unless proven otherwise.
@@ -23,6 +24,8 @@
 # Caveats:
 #   Many checks rely purely on existence of files.
 #
+## virtual.rb
+#
 
 require 'facter/util/virtual'
 
diff --git a/lib/facter/vlans.rb b/lib/facter/vlans.rb
index c09e4e0..d53876d 100644
--- a/lib/facter/vlans.rb
+++ b/lib/facter/vlans.rb
@@ -1,12 +1,14 @@
 # Fact: vlans
 #
-# Purpose: On Linux, return a list of all the VLANs on the system.
+# Purpose: 
+#   On Linux, return a list of all the VLANs on the system.
 #
-# Resolution: On Linux only, checks for and reads /proc/net/vlan/config and
-# parses it.
+# Resolution: 
+#   On Linux only, checks for and reads /proc/net/vlan/config and parses it.
 #
-# Caveats:
+## vlans.rb
 #
+
 require 'facter/util/vlans'
 
 Facter.add("vlans") do
diff --git a/lib/facter/xendomains.rb b/lib/facter/xendomains.rb
index 166b4e8..d34ac58 100644
--- a/lib/facter/xendomains.rb
+++ b/lib/facter/xendomains.rb
@@ -1,13 +1,15 @@
 # Fact: xendomains
 #
-# Purpose: Return the list of Xen domains on the Dom0.
+# Purpose: 
+#   Return the list of Xen domains on the Dom0.
 #
 # Resolution:
 #   On a Xen Dom0 host, return a list of Xen domains using the 'util/xendomains'
 #   library.
 #
-# Caveats:
+## xendomains.rb
 #
+
 require 'facter/util/xendomains'
 
 Facter.add("xendomains") do

    

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to