summaryrefslogtreecommitdiff
path: root/spec/unit/facter
AgeCommit message (Collapse)Author
2012-10-25(maint) Fix spec failures resulting from Facter API changesJeff McCune
Without this patch stdlib tests fail against Facter 2.x and master but not 1.6.x. This patch fixes the problem by initializing the example group differently depending on the version of Facter integrating into the system. The adjusted methods are: 1.x - Facter.collection.loader.load 2.x - Facter.collection.load The collection actually implements the load method in both version, it's simply marked as private in 1.x.
2012-10-25Revert "Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x""Jeff McCune
This reverts commit d6d23b495cda0e154b4e73982acc43e586564c0e. This backwards-compatible additional functionality is targeted at the next minor release. There are already backwards-incompatible changes in the master branch so we need to establish a new minor branch.
2012-10-25Revert "Merge branch 'haus-add_pe_facts_to_stdlib' into 2.4.x"Jeff McCune
This reverts commit 74e6411157b8df1af9a24c17971e3236f3096529, reversing changes made to 417d219aa6e42f2a16af42c98aa063fc1d9d2ecd. Here's why: Actually... I just screwed this up. I merged this new fact into 2.4.x but it's not fixing any bug. It's adding a new fact, so this should go into master and we should release 2.5 since this is new, backwards-compatible functionality.
2012-10-24Add spec tests for pe_version factsMatthaus Owens
This commit adds some basic spec tests for the pe_version facts. There are basic postitive and negative cases.
2012-03-06Merge pull request #44 from ↵Josh Cooper
jeffmccune/ticket/2.3.x/12357_add_puppet_settings_facts (#12357) Make facter_dot_d look in Puppet[:confdir]/facts.d
2012-03-05(#12357) Add puppet_vardir custom factJeff McCune
Without this patch the PE modules don't have a way to identify a filesystem path where it's OK to place variable data related to managing the target node. This is a problem when a module like pe_compliance needs to write a wrapper script to the node's filesystem. This patch addresses the problem by exposing the node's Puppet[:vardir] setting as a Facter fact. This fact value will be set to `nil` if Puppet is not loaded into memory. If Puppet is loaded, e.g. using `facter --puppet` or using `puppet agent` or `puppet apply` then the fact will automatically set the value to Puppet[:vardir] The value of this setting is subject to Puppet's run_mode. This patch implements a new utility method in the standard library module named `Facter::Util::PuppetSettings.with_puppet`. The method accepts a block and will only invoke the block if the Puppet library is loaded into the Ruby process. If Puppet is not loaded, the method always returns nil. This makes it easy to define Facter facts that only give values if Puppet is loaded in memory.
2012-03-05(#12357) Fix root_home fact on WindowsJeff McCune
Without this patch the root_home fact fails on windows. This patch fixes the problem by only calling methods on the object returned by the `getent passwd root` command if the object evaluates to true. Because there is no root account on Windows the code block simply returns `nil` which makes the Facter fact undefined on Windows platforms. The root cause of the failure is that we always expected the command to succeed and return something useful, and it may not on all supported platforms.
2011-10-03(#9859) Add root_home fact and testsJeff McCune
Without this patch applied, the stdlib module does not provide a root_home fact. This fact is necessary to easily determine the root account home directory on platforms Puppet is supported on. The major variations this fact address are: --- solaris: / linux: /root macosx: /var/root Spec tests using rspec have been provided as well to cover these three general cases. Windows tests are marked as pending.