Sha256: 58b7d83ef783244eafa59e23ab09dc3accc18430c051be07e4847c535687a4c0

Contents?: true

Size: 579 Bytes

Versions: 1

Compression:

Stored size: 579 Bytes

Contents

class Specinfra::HostInventory::Parser::Redhat::Base::Service < Specinfra::HostInventory::Parser::Base
  class << self
    def parse(cmd_ret)
      services = {}
      lines = cmd_ret.split(/\n/)
      lines.each do |line|
        status = line.split("\t")
        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

1 entries across 1 versions & 1 rubygems

Version Path
koma-0.3.0 lib/koma/ext/specinfra/host_inventory/parser/redhat/base/service.rb