@@ -17,7 +17,7 @@ def post_resolve(fact_name, _options)
1717
1818 def read_mount ( fact_name )
1919 @fact_list [ :mountpoints ] = { }
20- output = Facter ::Core ::Execution . execute ( 'mount' , logger : log )
20+ output = Facter ::Core ::Execution . execute ( 'mount -v ' , logger : log )
2121 output . split ( "\n " ) . map do |line |
2222 add_mount_points_fact ( line )
2323 end
@@ -27,11 +27,21 @@ def read_mount(fact_name)
2727 end
2828
2929 def add_mount_points_fact ( line )
30- ( elem , _ , options ) = line . partition ( "\s (" )
31- elem = elem . split ( "\s " )
32- options = options . chop! . split ( ",\s " )
33- @fact_list [ :mountpoints ] [ elem [ 2 ] ] = { device : elem [ 0 ] , filesystem : elem [ 4 ] ,
34- options : options }
30+ ( *tokens , options ) = line . split ( /\s *\( |\) \s */ , 0 )
31+
32+ if tokens . length == 3
33+ ( device , duid , tokens ) = tokens
34+ else
35+ ( device , tokens ) = tokens [ 0 ] . split ( "\s " , 2 )
36+ end
37+ ( _on , path , _type , filesystem ) = tokens . split ( "\s " )
38+
39+ @fact_list [ :mountpoints ] [ path ] = {
40+ device : device ,
41+ duid : duid ,
42+ filesystem : filesystem ,
43+ options : options . split ( ",\s " )
44+ } . compact
3545 end
3646
3747 def retrieve_sizes_for_mounts
0 commit comments