Permalink
Browse files

bugfix: use right AWS endpoint for configured availability zone

  • Loading branch information...
1 parent b6b4af8 commit 68094e2d2cea7ec409c3c5f8163089b1b7d3d238 Tim Lossen committed Nov 13, 2009
Showing with 12 additions and 2 deletions.
  1. +12 −2 lib/sumo.rb
View
@@ -263,6 +263,16 @@ def open_firewall(port)
end
def ec2
- @ec2 ||= AWS::EC2::Base.new(:access_key_id => config['access_id'], :secret_access_key => config['access_secret'])
- end
+ @ec2 ||= AWS::EC2::Base.new(
+ :access_key_id => config['access_id'],
+ :secret_access_key => config['access_secret'],
+ :server => server
+ )
+ end
+
+ def server
+ zone = config['availability_zone']
+ host = zone.slice(0, zone.length - 1)
+ "#{host}.ec2.amazonaws.com"
+ end
end

0 comments on commit 68094e2

Please sign in to comment.