class Crowbar::Client::Command::Upgrade::Cancel

Implementation for the upgrade cancel command

Public Instance Methods

execute() click to toggle source
# File lib/crowbar/client/command/upgrade/cancel.rb, line 31
def execute
  request.process do |request|
    case request.code
    when 200
      say "Canceled the upgrade process"
    when 422
      err "Failed to cancel the upgrade process"
    when 423
      err "Not possible to cancel the upgrade at this stage; Please refer to help output."
    else
      err request.parsed_response["error"]
    end
  end
end
request() click to toggle source
# File lib/crowbar/client/command/upgrade/cancel.rb, line 25
def request
  @request ||= Request::Upgrade::Cancel.new(
    args
  )
end