class Crowbar::Client::Command::Upgrade::Nodes

Implementation for the upgrade nodes command

Public Instance Methods

execute() click to toggle source
# File lib/crowbar/client/command/upgrade/nodes.rb, line 33
def execute
  request.process do |request|
    case request.code
    when 200
      case args.component
      when "all"
        say "Successfully triggered the upgrade of the nodes. "
      when "controllers"
        say "Successfully triggered the upgrade of the controller nodes. "
      when "postpone"
        say "The upgrade of compute nodes was postponed."
      when "resume"
        say "The upgrade process was resumed, compute nodes could be upgraded now."
      else
        say "Successfully triggered the upgrade of node #{args.component}. "
      end
      say "Query the upgrade status to follow the process with " \
        "'crowbarctl upgrade status'."
    else
      err format_error(
        request.parsed_response["error"], "nodes"
      )
    end
  end
end
request() click to toggle source
# File lib/crowbar/client/command/upgrade/nodes.rb, line 27
def request
  @request ||= Request::Upgrade::Nodes.new(
    args
  )
end