Sha256: b5cbddd09a496e31dd0a0efa4c52ded77730417110268f2083606c196bc9ea7e

Contents?: true

Size: 618 Bytes

Versions: 3

Compression:

Stored size: 618 Bytes

Contents

class Specinfra::HostInventory::Parser::Redhat::V7::Service < Specinfra::HostInventory::Parser::Redhat::Base::Service
  class << self
    def parse(cmd_ret)
      services = {}
      lines = cmd_ret.split(/\n/)
      lines.each do |line|
        status = line.split(/ +/)
        next unless status.count == 2
        service = status[0].gsub(/\.service\z/, '')
        cmd = backend.command.get(:check_service_is_running, service)
        services[service] = {
          enabled: status[1].include?('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/v7/service.rb
koma-0.16.0 lib/koma/ext/specinfra/host_inventory/parser/redhat/v7/service.rb
koma-0.15.0 lib/koma/ext/specinfra/host_inventory/parser/redhat/v7/service.rb