Sha256: 3567ea4412dd49761c089fa09e6c8333756d7d502ff442771d1632d09c037c65

Contents?: true

Size: 601 Bytes

Versions: 17

Compression:

Stored size: 601 Bytes

Contents

class Specinfra::HostInventory::Parser::Redhat::V7::Service < Specinfra::HostInventory::Parser::Base
  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

17 entries across 17 versions & 1 rubygems

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