lib/koma/ext/specinfra/host_inventory/package.rb in koma-0.14.0 vs lib/koma/ext/specinfra/host_inventory/package.rb in koma-0.15.0
- old
+ new
@@ -2,25 +2,18 @@
class HostInventory
class Package < Base
def get
cmd = backend.command.get(:get_inventory_package)
ret = backend.run_command(cmd)
- if ret.exit_status == 0
+ if ret.success?
parse(ret.stdout)
else
nil
end
end
def parse(cmd_ret)
- packages = {}
- lines = cmd_ret.split(/\n/)
- lines.each do |line|
- h = Hash[line.split("\t").map { |f| f.split(':', 2) }]
- idx = h['name']
- packages[idx] = h
- end
- packages
+ parser.get('package').parse(cmd_ret)
end
end
end
end