lib/facter/resolvers/macosx/filesystems_resolver.rb in facter-4.0.36 vs lib/facter/resolvers/macosx/filesystems_resolver.rb in facter-4.0.37
- old
+ new
@@ -3,11 +3,10 @@
module Facter
module Resolvers
module Macosx
class Filesystems < BaseResolver
# :macosx_filesystems
- @semaphore = Mutex.new
@fact_list ||= {}
class << self
private
@@ -15,14 +14,10 @@
@fact_list.fetch(fact_name) { read_filesystems(fact_name) }
end
def read_filesystems(fact_name)
output = Facter::Core::Execution.execute('mount', logger: log)
- filesystems = []
- output.each_line do |line|
- filesystem = line.match(/\(([a-z]+)\,*/).to_s
- filesystems << filesystem[1..-2]
- end
+ filesystems = output.scan(/\(([a-z]+)\,*/).flatten
@fact_list[:macosx_filesystems] = filesystems.uniq.sort.join(',')
@fact_list[fact_name]
end
end
end