Sha256: f6fb2d4a04f2c53d56bb93c5f0b88cf5accd776c2e6c5a46c1875277c5205b37

Contents?: true

Size: 617 Bytes

Versions: 16

Compression:

Stored size: 617 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")
        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

16 entries across 16 versions & 1 rubygems

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