File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -28,12 +28,16 @@ def uname_system_call(fact_name)
2828 def build_fact_list ( output )
2929 uname_results = output . split ( "\n " )
3030
31- @fact_list [ :machine ] = uname_results [ 0 ] . strip
32- @fact_list [ :nodename ] = uname_results [ 1 ] . strip
33- @fact_list [ :processor ] = uname_results [ 2 ] . strip
34- @fact_list [ :kernelrelease ] = uname_results [ 3 ] . strip
35- @fact_list [ :kernelname ] = uname_results [ 4 ] . strip
36- @fact_list [ :kernelversion ] = uname_results [ 5 ] . strip
31+ if !uname_results . empty?
32+ @fact_list [ :machine ] ,
33+ @fact_list [ :nodename ] ,
34+ @fact_list [ :processor ] ,
35+ @fact_list [ :kernelrelease ] ,
36+ @fact_list [ :kernelname ] ,
37+ @fact_list [ :kernelversion ] = uname_results . map ( &:strip )
38+ else
39+ log . warn ( 'Request to uname returned no output. Uname related facts are not populated.' )
40+ end
3741 end
3842 end
3943 end
You can’t perform that action at this time.
0 commit comments