out.flush

This commit is contained in:
amartynov 2015-08-18 17:53:39 +03:00
parent feba8717b1
commit cb32c9126b
3 changed files with 7 additions and 1 deletions

View File

@ -16,13 +16,16 @@ module StackCommands
puts stack.stack_status puts stack.stack_status
if stack.stack_status != 'CREATE_IN_PROGRESS' if stack.stack_status != 'CREATE_IN_PROGRESS'
mongo.stack_update(stack) mongo.stack_update(stack)
out << "Stack '#{stack.id}' status is now #{stack.stack_status}" out << "Stack '#{stack.id}' status is now #{stack.stack_status}\n"
out.flush
break break
end end
out << "Next try...\n" out << "Next try...\n"
out.flush
end end
rescue StandardError => e rescue StandardError => e
logger.error e.message logger.error e.message
out << "Error: #{e.message}\n"
return 5 return 5
end end
end end

View File

@ -211,6 +211,7 @@ module Provider
out << "Stack template: #{stack.stack_template}\n" out << "Stack template: #{stack.stack_template}\n"
out << "Stack parameters: #{stack.parameters}\n" out << "Stack parameters: #{stack.parameters}\n"
out << "Stack template: #{stack.template_body}\n" out << "Stack template: #{stack.template_body}\n"
out.flush
response = cloud_formation.create_stack(stack.name, response = cloud_formation.create_stack(stack.name,
{ {
'TemplateBody' => stack.template_body, 'TemplateBody' => stack.template_body,
@ -220,6 +221,7 @@ module Provider
) )
stack.id = response.body['StackId'] stack.id = response.body['StackId']
out << "Stack id: #{stack.id}\n" out << "Stack id: #{stack.id}\n"
out.flush
rescue Excon::Errors::Conflict => e rescue Excon::Errors::Conflict => e
raise ProviderErrors::NameConflict raise ProviderErrors::NameConflict
rescue Excon::Errors::BadRequest => br rescue Excon::Errors::BadRequest => br

View File

@ -30,6 +30,7 @@ class StackBootstrapWorker < Worker
sync_bootstrap_proc.call(out, stack, mongo) sync_bootstrap_proc.call(out, stack, mongo)
out << "\nStack '#{stack.name}' has been created\n" out << "\nStack '#{stack.name}' has been created\n"
out.flush
servers = persist_stack_servers!(stack, provider) servers = persist_stack_servers!(stack, provider)
unless options['stack_attributes']['without_bootstrap'] unless options['stack_attributes']['without_bootstrap']
statuses = servers.map do |s| statuses = servers.map do |s|