summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* (#7670) Stop preloading all facts in the applicationNick Lewis2011-05-311-4/+3
| | | | | | | | | | If a requested fact isn't found in the same location as its name, we want to load all of the facts to find it. However, to simplify that, we were previously just preloading all the facts every time. Because requesting a fact now implicitly loads all facts if necessary, we can rely on that, providing results much more quickly in the case where facts do match their filenames. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
* (#7670) Never fail to find a fact that is presentNick Lewis2011-05-311-1/+5
| | | | | | | | | | | | | | | | | | | | | With the previous behavior, any fact which depended on another fact in a file not matching its name would fail to properly load the required fact, resulting in missing, incorrect, or inconsistent values. For instance, the operatingsystem fact depends on the lsbdistid fact found in lsb.rb. The first time the operatingsystem fact is requested, it requires lsb.rb, and so the required fact is loaded first. But if Facter is subsequently cleared and the operatingsystem fact requested again, the require will not occur, and the fact will not be automatically loaded because it doesn't match its filename. Now if a fact is requested and can't be found, we will attempt to load all the facts to find it. Such an approach appears heavy-handed, but in the case where we want a particular fact, this is the only way to make sure we've found it. In the case where we eventually want other facts, we are conveniently eagerly loading them. Paired-With: Jacob Helwig <jacob@puppetlabs.com>
* Merge branch 'master' into nextJacob Helwig2011-05-202-7/+9
|\ | | | | | | | | | | | | | | | | | | * master: Update CHANGELOG for 1.5.9 Updated CHANGELOG for 1.5.9rc6 Removed inappropriately uncredited Ohai method from ec2 fact Add facter test for ticket 7039 downcase arp output so that the ec2 arp is matched (#7039) Pre-load all facts when requesting a single fact
| * Removed inappropriately uncredited Ohai method from ec2 factJames Turnbull2011-05-092-40/+18
| |
| * downcase arp output so that the ec2 arp is matchedJeremy Katz2011-04-181-1/+1
| | | | | | | | | | CentOS 5.4 arp gives the arp output as uppercase; downcase it so we're ensured a match
| * (#7039) Pre-load all facts when requesting a single factJacob Helwig2011-04-121-6/+8
| | | | | | | | | | | | | | | | Since multiple facts can be defined in a single file and we have no way of knowing which "additional" facts are defined in which files, we pre-load all facts when we're looking for specific one. Paired-with: Max Martin <max@puppetlabs.com>
| * Ensures that ARP facts are returned only on EC2 hostsOhad Levy2011-04-062-15/+13
| | | | | | | | | | | | | | | | ARP facts on large network might lead to inconstant values as we are always using the first ARP entry from the output of the ARP command Signed-off-by: Ohad Levy <ohadlevy@gmail.com>
* | Removed inappropriately uncredited Ohai method from ec2 factJames Turnbull2011-05-042-40/+18
| |
* | Merge branch ↵Max Martin2011-04-281-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | 'ticket/next/6728-facter_improperly_detects_openvzve_on_cloudlinux_systems' into next * ticket/next/6728-facter_improperly_detects_openvzve_on_cloudlinux_systems: (#6728) Facter improperly detects openvzve on CloudLinux systems (#6883) Update Facter install.rb to be slightly more informative.
| * | (#6728) Facter improperly detects openvzve on CloudLinux systemsBen Hughes2011-04-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Make the openvz check for more than just the vz directory to be sure it's OpenVZ. Update the OpenVZ fact to be slightly more resilient in it's checking of OpenVZ, so it doesn't clash with CloudLinux's LVE container system.
* | | (#6614) Update ipaddress6 fact to work with Ruby 1.9Jacob Helwig2011-04-221-31/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling #to_s on an Array such as ["foo"] in Ruby 1.9 will result in the string '["foo"]', instead of stringifying the element in the array which would have given the expected result of "foo". Since the element of the array we're dealing with is already a string, we can just grab it out of the array by using #first. Paired-with: Josh Cooper <josh@puppetlabs.com>
* | | (#5135) Fix faulty logic in physicalprocessorcountAdrien Thebo2011-04-061-5/+2
| | | | | | | | | | | | | | | | | | - Was doing unnessary string manipulation when all that needed to be done was a uniq'd array. - Removed some backwards way of nil checking.
* | | Merge branch 'tickets/master/6976' into nextJames Turnbull2011-04-062-15/+13
|\ \ \ | | | | | | | | | | | | | | | | * tickets/master/6976: Ensures that ARP facts are returned only on EC2 hosts
| * | | Ensures that ARP facts are returned only on EC2 hostsOhad Levy2011-04-062-15/+13
| | |/ | |/| | | | | | | | | | | | | | | | | | | ARP facts on large network might lead to inconstant values as we are always using the first ARP entry from the output of the ARP command Signed-off-by: Ohad Levy <ohadlevy@gmail.com>
* | | Fixed #6974 - Moved to Apache 2.0 licenseJames Turnbull2011-04-067-81/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is in line with our proposed plan to change from the GPL license to Apache 2.0. Please see this link for further explanation: https://groups.google.com/d/topic/puppet-users/NuspYhMpE5o/discussion
* | | refactor the mechanism for allowing for resolution ordering to be influencedRichard Clamp2011-04-063-14/+9
| | | | | | | | | | | | | | | renames Facter::Util::Resolution#length to weight as a more generic mechanism for allowing resolutions to state their importance
* | | (#6740) facter doesn't always respect facts in environment variablesRichard Clamp2011-04-062-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On an OSX host: $ facter operatingsystem Darwin $ facter_operatingsystem=Not_Darwin facter operatingsystem Not_Darwin But on a linux/solaris host: $ facter operatingsystem CentOS $ facter_operatingsystem=Not_CentOS facter operatingsystem CentOS As the operatingsystem fact resolution for linux-based kernels has higher precedence than the environment variable as it has more matching confines than the value from the environment variable. This patch adds from_environment to the resolution mechanism, which makes the resolution have an artificially high weight by claiming the length of its confines array is 1 billion.
* | | Merge remote branch 'adrien/tickets/next/6719' into nextJames Turnbull2011-04-061-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * adrien/tickets/next/6719: (#6719) Corrected faulty logic in bugfix Conflicts: lib/facter/virtual.rb
| * | | (#6719) Corrected faulty logic in bugfixAdrien Thebo2011-04-011-1/+1
| | | |
* | | | Merge remote branch 'adrien/tickets/next/2714' into nextJames Turnbull2011-04-061-2/+5
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | * adrien/tickets/next/2714: (#2714) Fixed faulty test (#2714) Added timeout to prtdiag resulution
| * | | | (#2714) Added timeout to prtdiag resulutionAdrien Thebo2011-04-011-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | - prtdiag would hang in specific cases, subsequently hanging facter. This should kill prtdiag if it takes excessively long.
* | | | | Fixed #5135 - Facter returns physicalprocessorcount => 0 on a physical computerJames Turnbull2011-04-061-6/+47
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | (#5135) Refactored physicalprocessorcountAdrien Thebo2011-04-011-6/+8
| | | | | | | | | | | | | | | | | | | | - Refactored code to make testing simpler
| * | | | Re-factor. Do not use pure-Ruby file reading against "/proc/cpuinfo" and ↵Krzysztof Wilczynski2011-04-011-3/+9
| | | | | | | | | | | | | | | | | | | | possibly any entry under "/sys" from the sysfs file system.
| * | | | Fix. Using sysfs file system entries to count the number of physical CPUs. ↵Krzysztof Wilczynski2011-04-011-6/+39
| | | | | | | | | | | | | | | | | | | | Fall-back to "/proc/cpuinfo" included for backward-compatibility with legacy systems.
| * | | | (#3856) Add virtualbox detection via lspci (graphics card), dmidecode, and ↵Michael Kincaid2011-04-011-0/+5
| | | | | | | | | | | | | | | | | | | | prtdiag for Solaris and corresponding tests. Darwin case is not handled yet.
| * | | | (#5394) Document each Facter fact.Ben H2011-04-0144-10/+555
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Document all the builtin Facter facts in puppetdoc/rdoc format. This is laying the ground work for using a tool like puppet doc, or puppet describe but for facter, so you can see what a fact is for and how it resolves this. This is the "leg work" of documenting the actual facts, and the syntax of them may change in future.
| * | | | (#6613) Switch solaris macaddress fact to netstatAdrien Thebo2011-04-011-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | - ifconfig on solaris will only return the mac address if run as root. netstat -np will provide the information to any user.
| * | | | (#6817) Fix for Ruby 1.9 by calling .each_line on a stringMatt Robinson2011-04-011-1/+1
| | | | |
| * | | | maint: cleanup whitespaceMatt Robinson2011-04-012-19/+18
| | |/ / | |/| |
* | | | (#3856) Add virtualbox detection via lspci (graphics card), dmidecode, and ↵Michael Kincaid2011-04-011-0/+5
| | | | | | | | | | | | | | | | prtdiag for Solaris and corresponding tests. Darwin case is not handled yet.
* | | | Merge remote branch ↵James Turnbull2011-04-0144-10/+555
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'barn/tickets/next/5394-Improve_Facter_fact_value_documentation' into next * barn/tickets/next/5394-Improve_Facter_fact_value_documentation: (#5394) Document each Facter fact.
| * | | | (#5394) Document each Facter fact.Ben H2011-03-3144-10/+555
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Document all the builtin Facter facts in puppetdoc/rdoc format. This is laying the ground work for using a tool like puppet doc, or puppet describe but for facter, so you can see what a fact is for and how it resolves this. This is the "leg work" of documenting the actual facts, and the syntax of them may change in future.
* | | | Merge remote branch 'adrien/tickets/next/6613' into nextJames Turnbull2011-04-011-0/+12
|\ \ \ \ | |/ / / |/| | | | | | | | | | | * adrien/tickets/next/6613: (#6613) Switch solaris macaddress fact to netstat
| * | | (#6613) Switch solaris macaddress fact to netstatAdrien Thebo2011-03-281-0/+12
| |/ / | | | | | | | | | | | | - ifconfig on solaris will only return the mac address if run as root. netstat -np will provide the information to any user.
* | | (#6817) Fix for Ruby 1.9 by calling .each_line on a stringMatt Robinson2011-03-221-1/+1
| | |
* | | maint: cleanup whitespaceMatt Robinson2011-03-222-19/+18
|/ /
* | (#6795) xendomains: Ignore error output from xm listTodd Zullinger2011-03-211-1/+1
| | | | | | | | | | If xend is not running, xm list writes to stderr and facter propagates this to the user. Redirect stderr to /dev/null.
* | (#6763) Use Facter::Util::Resolution.exec for arpTodd Zullinger2011-03-181-3/+5
| | | | | | | | | | The arp command is in /sbin on Fedora/RHEL, not /usr/sbin. Using Facter::Util::Resolution.exec is preferable to hard-coding the path.
* | arp: Cleanup indendationTodd Zullinger2011-03-181-13/+13
| |
* | Merge branch 'tickets/next/6716-osx-ipv6-macaddress' into nextJacob Helwig2011-03-171-1/+1
|\ \ | | | | | | | | | | | | | | | * tickets/next/6716-osx-ipv6-macaddress: Clean up indentation, and alignment in macaddress_spec.rb (#6716) fix facter issues on OSX with ipv6 in macaddress.rb.
| * | (#6716) fix facter issues on OSX with ipv6 in macaddress.rb.Ben Hughes2011-03-171-1/+1
| | | | | | | | | | | | | | | | | | Due to "netstat -rn" returning multiple protocols (IPv4 and IPv6) the "default_interface" can get more than one entry in to it, causing the macaddress resolving to break. This limits it to just one interface.
* | | Fixed #2346 - A much cleverer EC2 factJames Turnbull2011-03-171-18/+64
| | | | | | | | | | | | | | | | | | | | | | | | The fact now checks for an EC2 ARP or in the EU Zone for an EC2 MAC This should mean the fact's return is much more robust The fact also now supports returning userdata (which is a bit ugly given Facter returns strings but a good bookmark for refactor in 2.0)
* | | Fixed #2346 - Part 1: Added arp fact for LinuxJames Turnbull2011-03-172-0/+29
| | | | | | | | | | | | | | | Added facts arp (like the ipaddress etc) facts Added facts arp_interfacename
* | | Discussion on ec2 facts - #2346Paul Nasrat2011-03-171-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The EC2 fact is completely broken at the moment: * Timeout::Error isn't caught by rescue (due to how it inherits) * The issue of wrong open semantics outlined here, this is causing hidden immediate failure * The fact is going to cause a 2 second wait to every facter run Whilst the following patch fixes the first two, I'm not sure we want to take the timeout hit, we also want to add tests as even simple ruby code can get logic errors such as the open(). Signed-off-by: Paul Nasrat <pnas...@googlemail.com>
* | | Fixed #3087 - Identify VMWareJames Turnbull2011-03-172-1/+20
| | | | | | | | | | | | | | | | | | | | | Added support for VMWareESX and ESXi to operatingsystem and operatingsystemrelease facts Added appropriate tests
* | | (#6327) Memory facts should be available on Mac DarwinBen H2011-03-172-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no easy defined way of getting memory information from the command line. Copying mainly the OpenBSD facts, but having to pull in memory free from the vm_stat utility, and parsing the weird vm.swapusage sysctl value for swap. Parsing "top -l 1 -n 0" seemed an option, but that took over a second to run each time, so this appears cheaper.
* | | Merge branch 'tickets/master/6695' into nextJames Turnbull2011-03-171-9/+2
|\ \ \
| * | | Fixed #6695 - Updated id fact for Darwin et alJames Turnbull2011-03-151-9/+2
| |/ /
* | | Incremented release to 1.5.9James Turnbull2011-03-171-1/+1
| | |