Merge pull request #547 from reidmv/fm_3773
(FM-3773) Fix root_home fact on AIX 5.x
This commit is contained in:
commit
13e307b2c6
2 changed files with 2 additions and 2 deletions
|
@ -35,7 +35,7 @@ Facter.add(:root_home) do
|
||||||
confine :kernel => :aix
|
confine :kernel => :aix
|
||||||
root_home = nil
|
root_home = nil
|
||||||
setcode do
|
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|
|
str && str.split("\n").each do |line|
|
||||||
next if line =~ /^#/
|
next if line =~ /^#/
|
||||||
root_home = line.split(/:/)[1]
|
root_home = line.split(/:/)[1]
|
||||||
|
|
|
@ -58,7 +58,7 @@ describe 'root_home', :type => :fact do
|
||||||
sample_lsuser = File.read(fixtures('lsuser','root'))
|
sample_lsuser = File.read(fixtures('lsuser','root'))
|
||||||
|
|
||||||
it "should return /root" do
|
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)
|
expect(Facter.fact(:root_home).value).to eq(expected_root_home)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue