class Crowbar::Client::App::Services

A Thor based CLI wrapper for Services commands

Public Instance Methods

clear_restart(node, cookbook = nil, service = nil) click to toggle source
# File lib/crowbar/client/app/services.rb, line 45
def clear_restart(node, cookbook = nil, service = nil)
  Command::Services::ClearServiceRestart.new(
    *command_params(
      node: node,
      cookbook: cookbook,
      service: service
    )
  ).execute
rescue => e
  catch_errors(e)
end
disable_restart(cookbook, value) click to toggle source
# File lib/crowbar/client/app/services.rb, line 68
def disable_restart(cookbook, value)
  unless ["true", "false"].include? value.downcase
    msg = "#{value} is not a valid value for this command. Please use true or false"
    raise SimpleCatchableError(msg)
  end
  value = value.casecmp("true").zero? ? true : false
  Command::Services::SetRestartFlag.new(
    *command_params(
      cookbook: cookbook,
      disallow_restart: value
    )
  ).execute
rescue => e
  catch_errors(e)
end
list_restarts() click to toggle source
# File lib/crowbar/client/app/services.rb, line 32
def list_restarts
  Command::Services::ListServiceRestarts.new(*command_params).execute
rescue => e
  catch_errors(e)
end
restart_flags() click to toggle source
# File lib/crowbar/client/app/services.rb, line 60
def restart_flags
  Command::Services::ListRestartFlags.new(*command_params).execute
rescue => e
  catch_errors(e)
end