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

Version Path
koma-0.14.0 lib/koma/ext/specinfra/host_inventory/package.rb
koma-0.13.0 lib/koma/ext/specinfra/host_inventory/package.rb
koma-0.12.0 lib/koma/ext/specinfra/host_inventory/package.rb
koma-0.11.0 lib/koma/ext/specinfra/host_inventory/package.rb
koma-0.10.1 lib/koma/ext/specinfra/host_inventory/package.rb
koma-0.10.0 lib/koma/ext/specinfra/host_inventory/package.rb
koma-0.9.0 lib/koma/ext/specinfra/host_inventory/package.rb
koma-0.8.0 lib/koma/ext/specinfra/host_inventory/package.rb
koma-0.7.3 lib/koma/ext/specinfra/host_inventory/package.rb
koma-0.7.2 lib/koma/ext/specinfra/host_inventory/package.rb
koma-0.7.1 lib/koma/ext/specinfra/host_inventory/package.rb
koma-0.7.0 lib/koma/ext/specinfra/host_inventory/package.rb
koma-0.6.0 lib/koma/ext/specinfra/host_inventory/package.rb
koma-0.5.0 lib/koma/ext/specinfra/host_inventory/package.rb
koma-0.4.0 lib/koma/ext/specinfra/host_inventory/package.rb
koma-0.3.1 lib/koma/ext/specinfra/host_inventory/package.rb
koma-0.3.0 lib/koma/ext/specinfra/host_inventory/package.rb
koma-0.2.0 lib/koma/ext/specinfra/host_inventory/package.rb
koma-0.1.0 lib/koma/ext/specinfra/host_inventory/package.rb