lib/specinfra/host_inventory/filesystem.rb in specinfra-2.36.0 vs lib/specinfra/host_inventory/filesystem.rb in specinfra-2.36.1
- old
+ new
@@ -1,11 +1,15 @@
module Specinfra
class HostInventory
class Filesystem < Base
def get
cmd = backend.command.get(:get_inventory_filesystem)
+ ret = backend.run_command(cmd).stdout.lines
+ parse(ret)
+ end
+ def parse(ret)
filesystem = {}
- backend.run_command(cmd).stdout.lines do |line|
+ ret.each do |line|
next if line =~ /^Filesystem\s+/
if line =~ /^(.+?)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+\%)\s+(.+)$/
device = $1
filesystem[device] = {}
filesystem[device]['kb_size'] = $2