summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Vandewiele <reid@puppetlabs.com>2015-11-19 15:29:06 -0800
committerReid Vandewiele <reid@puppetlabs.com>2015-11-19 15:44:52 -0800
commit13e5d467c97deb530f99e4a82c73b1aff97c9787 (patch)
tree5ca8a51ff9dfbe15bcf42e11d19e8767b5f37411
parent61333cfc48026af204483d681bd8b10cb44d6fc6 (diff)
downloadpuppet-stdlib-13e5d467c97deb530f99e4a82c73b1aff97c9787.tar.gz
puppet-stdlib-13e5d467c97deb530f99e4a82c73b1aff97c9787.tar.bz2
(FM-3773) Fix root_home fact on AIX 5.x
The -C (capital C) flag to lsuser is incorrect. It should be -c (lowercase). this commit updates the aix root_home fact to use `lsuser -c`, rather than `lsuser -C`.
-rw-r--r--lib/facter/root_home.rb2
-rwxr-xr-xspec/unit/facter/root_home_spec.rb2
2 files changed, 2 insertions, 2 deletions
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