Module: ForemanMaintain::Utils

Defined in:
lib/foreman_maintain/utils/bash.rb,
lib/foreman_maintain/utils/backup.rb,
lib/foreman_maintain/utils/service.rb,
lib/foreman_maintain/utils/response.rb,
lib/foreman_maintain/utils/disk/stats.rb,
lib/foreman_maintain/utils/hash_tools.rb,
lib/foreman_maintain/utils/disk/device.rb,
lib/foreman_maintain/utils/curl_response.rb,
lib/foreman_maintain/utils/command_runner.rb,
lib/foreman_maintain/utils/disk/io_device.rb,
lib/foreman_maintain/utils/system_helpers.rb,
lib/foreman_maintain/utils/disk/nil_device.rb,
lib/foreman_maintain/utils/service/systemd.rb,
lib/foreman_maintain/utils/service/abstract.rb,
lib/foreman_maintain/utils/service/remote_db.rb

Defined Under Namespace

Modules: Bash, Disk, HashTools, Service Classes: Backup, CommandRunner, CurlResponse, Response, SystemHelpers

Class Method Summary collapse

Class Method Details

.system_service(name, priority, options = {}) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/foreman_maintain/utils/service.rb', line 6

def self.system_service(name, priority, options = {})
  db_feature = options.fetch(:db_feature, nil)
  if db_feature.respond_to?(:local?) && !db_feature.local?
    Service::RemoteDB.new(name, priority, options)
  else
    Service::Systemd.new(name, priority, options)
  end
end

.valid_sys_service?(service) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/foreman_maintain/utils/service.rb', line 15

def self.valid_sys_service?(service)
  service.class < Service::Abstract
end