Exception: ElasticBeans::Command::SSH::NoInstanceError

Inherits:
Error
  • Object
show all
Defined in:
lib/elastic_beans/command/ssh.rb

Instance Method Summary collapse

Constructor Details

#initialize(environment:, index:) ⇒ NoInstanceError

Returns a new instance of NoInstanceError.



115
116
117
118
# File 'lib/elastic_beans/command/ssh.rb', line 115

def initialize(environment:, index:)
  @environment = environment
  @index = index
end

Instance Method Details

#messageObject



120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/elastic_beans/command/ssh.rb', line 120

def message
  msg = "The '#{@environment.name}' environment has no instance at index #{@index}.\n"
  if @index > 0
    msg << "Try again with a lower index.\n"
  else
    msg << "Wait for instances to be created and try again.\n"
  end
  msg << <<-MESSAGE

#{command_help "ssh"}
  MESSAGE
  msg
end