]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
(FM-3773) Fix root_home fact on AIX 5.x
authorReid Vandewiele <reid@puppetlabs.com>
Thu, 19 Nov 2015 23:29:06 +0000 (15:29 -0800)
committerReid Vandewiele <reid@puppetlabs.com>
Thu, 19 Nov 2015 23:44:52 +0000 (15:44 -0800)
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`.

lib/facter/root_home.rb
spec/unit/facter/root_home_spec.rb

index ee3ffa8ced01dd61e10824f9bd50787fe72a249e..87c76571885be2d23b5b43620032c0e6e703d8f2 100644 (file)
@@ -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]
index ac5160a7ff246a4a417fa657987ee94b623109b1..a5c2846ec0adaedd7c7ccb47cfed7180ae35addb 100755 (executable)
@@ -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