Sha256: 78bca2649059961a52a4df480772b943f1e4d332f4e9a603426760f6d0e1122c

Contents?: true

Size: 692 Bytes

Versions: 192

Compression:

Stored size: 692 Bytes

Contents

module Specinfra
  class HostInventory
    class Kernel < Base
      def get
        kernel = {}
        kernel['machine'] = backend.os_info[:arch]

        cmd = backend.command.get(:get_inventory_kernel)
        ret = backend.run_command(cmd)
        if ret.exit_status == 0
          kernel = kernel.merge(parse_uname(ret.stdout))
        end
        kernel
      end

      def parse_uname(ret)
        match = ret.match(/^(\w+) (((\d+\.\d+)\.\d+).*)$/)
        if match
          name, release, version, major = match.captures
          Hash['name', name, "release", release, "version", version, "version_major", major]
        else
          nil
        end
      end
    end
  end
end

Version data entries

192 entries across 192 versions & 3 rubygems

Version Path
specinfra-2.76.5 lib/specinfra/host_inventory/kernel.rb
specinfra-2.76.4 lib/specinfra/host_inventory/kernel.rb
specinfra-2.76.3 lib/specinfra/host_inventory/kernel.rb
specinfra-2.76.2 lib/specinfra/host_inventory/kernel.rb
specinfra-2.76.1 lib/specinfra/host_inventory/kernel.rb
specinfra-2.76.0 lib/specinfra/host_inventory/kernel.rb
specinfra-2.75.1 lib/specinfra/host_inventory/kernel.rb
specinfra-rb19-2.44.7 lib/specinfra/host_inventory/kernel.rb
specinfra-2.75.0 lib/specinfra/host_inventory/kernel.rb
specinfra-2.74.0 lib/specinfra/host_inventory/kernel.rb
specinfra-2.73.4 lib/specinfra/host_inventory/kernel.rb
specinfra-2.73.3 lib/specinfra/host_inventory/kernel.rb
specinfra-2.73.2 lib/specinfra/host_inventory/kernel.rb
specinfra-2.73.1 lib/specinfra/host_inventory/kernel.rb
specinfra-2.73.0 lib/specinfra/host_inventory/kernel.rb
specinfra-2.72.1 lib/specinfra/host_inventory/kernel.rb
specinfra-2.72.0 lib/specinfra/host_inventory/kernel.rb
specinfra-2.71.3 lib/specinfra/host_inventory/kernel.rb
specinfra-2.71.2 lib/specinfra/host_inventory/kernel.rb
specinfra-2.71.1 lib/specinfra/host_inventory/kernel.rb