Merge branch 'devops_3' into handling_stack_exceptions

This commit is contained in:
Anton Chuchkalov 2015-09-21 20:32:09 +03:00
commit feef03efc5
3 changed files with 9 additions and 9 deletions

View File

@ -8,7 +8,8 @@ module Devops
end end
def stack_status def stack_status
details['StackStatus'] if details puts self.details.inspect
self.details['StackStatus'] if self.details
end end
def bson_safe_details def bson_safe_details

View File

@ -152,8 +152,8 @@ module Devops
cmd << "#{address} 'exit'" cmd << "#{address} 'exit'"
cmd << " 2>&1" cmd << " 2>&1"
@out.puts "\nWaiting for SSH..." @out << "\nWaiting for SSH..."
@out.puts "Test command: '#{cmd}'" @out << "\nTest command: '#{cmd}'\n"
@out.flush @out.flush
retries_amount = 0 retries_amount = 0

View File

@ -157,7 +157,8 @@ module Provider
end end
s.public_ip = details["ipAddress"] s.public_ip = details["ipAddress"]
s.private_ip = details["privateIpAddress"] s.private_ip = details["privateIpAddress"]
# set_server_tags(s) tags = set_server_tags(s)
out << "\nServer tags: #{tags.inspect}\n"
out << "\nDone\n\n" out << "\nDone\n\n"
out << s.info out << s.info
@ -168,6 +169,7 @@ module Provider
tags = { tags = {
} }
compute.create_tags(s.id, tags) compute.create_tags(s.id, tags)
tags
end end
def delete_server s def delete_server s
@ -283,11 +285,8 @@ module Provider
end end
def stack_details(stack) def stack_details(stack)
response = cloud_formation.describe_stacks({'StackName' => stack.name}).body['Stacks'] b = cloud_formation.describe_stacks({'StackName' => stack.name}).body
# somewhy it sometimes returns blank results b['Stacks'].detect{|s| s.key?("StackStatus")} || {}
response.detect do |t|
t.has_key?('StackName')
end
end end
def stack_resources(stack) def stack_resources(stack)