Sha256: f6aa2fe3e131a01a3d7ce095860c9d5e42d0fd56fefc549419e3f21ac955e9f2

Contents?: true

Size: 627 Bytes

Versions: 3

Compression:

Stored size: 627 Bytes

Contents

class Specinfra::HostInventory::Parser::Redhat::Base::Service < Specinfra::HostInventory::Parser::Linux::Service
  class << self
    def parse(cmd_ret)
      services = {}
      lines = cmd_ret.split(/\n/)
      lines.each do |line|
        status = line.split("\t")
        next unless status.count == 8
        service = status[0].strip
        enabled = status[4].include?(':on') # level 3
        cmd = backend.command.get(:check_service_is_running, service)
        services[service] = {
          enabled: enabled,
          running: backend.run_command(cmd).success?
        }
      end
      services
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
koma-0.17.0 lib/koma/ext/specinfra/host_inventory/parser/redhat/base/service.rb
koma-0.16.0 lib/koma/ext/specinfra/host_inventory/parser/redhat/base/service.rb
koma-0.15.0 lib/koma/ext/specinfra/host_inventory/parser/redhat/base/service.rb