Sha256: 478b2e88c3bbfd283175f2308853e1f2a5e79cfb65bc0e1d311b6cc9e0bc4ad7
Contents?: true
Size: 573 Bytes
Versions: 19
Compression:
Stored size: 573 Bytes
Contents
module Specinfra class HostInventory class Package < Base def get cmd = backend.command.get(:get_inventory_package) ret = backend.run_command(cmd) if ret.exit_status == 0 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 end end end end
Version data entries
19 entries across 19 versions & 1 rubygems