Class: Crowbar::Client::Command::Upgrade::Database
- Includes:
- Mixin::Database, Mixin::UpgradeError
- Defined in:
- lib/crowbar/client/command/upgrade/database.rb
Overview
Implementation for the upgrade Database command
Constant Summary
Constants included from Mixin::Database
Mixin::Database::REGEX_DATABASE, Mixin::Database::REGEX_HOSTNAME, Mixin::Database::REGEX_IPV4, Mixin::Database::REGEX_PASSWORD, Mixin::Database::REGEX_PORT, Mixin::Database::REGEX_USERNAME
Instance Attribute Summary
Attributes inherited from Base
#args, #options, #stderr, #stdin, #stdout
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Crowbar::Client::Command::Base
Instance Method Details
#args_with_options ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/crowbar/client/command/upgrade/database.rb', line 30 def args.easy_merge!( username: .db_username, password: .db_password, database: .database, host: .host, port: .port ) end |
#execute ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/crowbar/client/command/upgrade/database.rb', line 46 def execute validate_params!() request.process do |request| unless request.code == 200 err format_error( request.parsed_response["error"], "database" ) end response = JSON.parse(request.body) .each do |step, | next if response[step.to_s]["success"] err "Failed to #{}" end say "Successfully initialized Crowbar" say "Next step: 'crowbarctl upgrade repocheck nodes'" end end |