File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change 1515Facter . add ( 'lvm_vgs' ) do
1616 confine :lvm_support => true
1717
18- lvm = Facter . value ( :lvm_support )
19- if lvm
20- vgs = Facter ::Core ::Execution . execute ( 'vgs -o name --noheadings 2>/dev/null' , timeout : 30 )
21- end
18+ vgs = Facter ::Core ::Execution . execute ( 'vgs -o name --noheadings 2>/dev/null' , timeout : 30 )
2219 if vgs . nil?
2320 setcode { 0 }
2421 else
4946Facter . add ( 'lvm_pvs' ) do
5047 confine :lvm_support => true
5148
52- lvm = Facter . value ( :lvm_support )
53- if lvm
54- pvs = Facter ::Core ::Execution . execute ( 'pvs -o name --noheadings 2>/dev/null' , timeout : 30 )
55- end
49+ pvs = Facter ::Core ::Execution . execute ( 'pvs -o name --noheadings 2>/dev/null' , timeout : 30 )
5650 if pvs . nil?
5751 setcode { 0 }
5852 else
Original file line number Diff line number Diff line change 5252 context 'when there is lvm support' do
5353 context 'when there are no vgs' do
5454 it 'should be set to 0' do
55- Facter . fact ( :lvm_support ) . expects ( :value ) . at_least ( 1 ) . returns ( true )
5655 Facter ::Core ::Execution . stubs ( :execute ) # All other calls
5756 Facter ::Core ::Execution . expects ( :execute ) . at_least ( 1 ) . with ( 'vgs -o name --noheadings 2>/dev/null' , timeout : 30 ) . returns ( nil )
57+ Facter . fact ( :lvm_support ) . expects ( :value ) . at_least ( 1 ) . returns ( true )
5858 Facter . value ( :lvm_vgs ) . should == 0
5959 end
6060 end
You can’t perform that action at this time.
0 commit comments