summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.markdown4
-rw-r--r--lib/facter/root_home.rb2
-rwxr-xr-xspec/unit/facter/root_home_spec.rb2
3 files changed, 6 insertions, 2 deletions
diff --git a/README.markdown b/README.markdown
index 57a62b6..9ff242c 100644
--- a/README.markdown
+++ b/README.markdown
@@ -624,6 +624,10 @@ From a list of values, returns the first value that is not undefined or an empty
*Type*: rvalue.
+#### `pick_default`
+
+Will return the first value in a list of values. Contrary to the 'pick()' function, the 'pick_default()' does not fail if all arguments are empty. This allows it to use an empty value as default. *Type*: rvalue.
+
#### `prefix`
Applies a prefix to all elements in an array, or to the keys in a hash.
diff --git a/lib/facter/root_home.rb b/lib/facter/root_home.rb
index ee3ffa8..87c7657 100644
--- a/lib/facter/root_home.rb
+++ b/lib/facter/root_home.rb
@@ -35,7 +35,7 @@ Facter.add(:root_home) do
confine :kernel => :aix
root_home = nil
setcode do
- str = Facter::Util::Resolution.exec("lsuser -C -a home root")
+ str = Facter::Util::Resolution.exec("lsuser -c -a home root")
str && str.split("\n").each do |line|
next if line =~ /^#/
root_home = line.split(/:/)[1]
diff --git a/spec/unit/facter/root_home_spec.rb b/spec/unit/facter/root_home_spec.rb
index ac5160a..a5c2846 100755
--- a/spec/unit/facter/root_home_spec.rb
+++ b/spec/unit/facter/root_home_spec.rb
@@ -58,7 +58,7 @@ describe 'root_home', :type => :fact do
sample_lsuser = File.read(fixtures('lsuser','root'))
it "should return /root" do
- Facter::Util::Resolution.stubs(:exec).with("lsuser -C -a home root").returns(sample_lsuser)
+ Facter::Util::Resolution.stubs(:exec).with("lsuser -c -a home root").returns(sample_lsuser)
expect(Facter.fact(:root_home).value).to eq(expected_root_home)
end
end