Permalink
Browse files

Merge remote-tracking branch 'internal/public_right_aws' into develop…

…ment
  • Loading branch information...
2 parents a959a8c + 980ddb5 commit 2701199cd014fc7698e820ecc462f947a5be19f1 konstantin committed Apr 10, 2012
Showing with 41 additions and 17 deletions.
  1. +7 −0 History.txt
  2. +12 −10 lib/awsbase/right_awsbase.rb
  3. +13 −3 lib/ec2/right_ec2.rb
  4. +9 −4 lib/ec2/right_ec2_security_groups.rb
View
@@ -339,3 +339,10 @@ the source key.
- Fixed:
- S3 Content-Type not set in Ruby 1.9.2
- error in rds_interface describe_db_snapshots in Ruby 1.9.2
+
+
+=== 3.0.4
+ Release Notes:
+ - Fixed:
+ - #125 - fixes redirect bug in file PUT requests (Cary)
+ - some other minor fixes
@@ -1101,19 +1101,21 @@ def check(request) #:nodoc:
sleep @reiteration_delay
@reiteration_delay *= 2
- # Always make sure that the fp is set to point to the beginning(?)
- # of the File/IO. TODO: it assumes that offset is 0, which is bad.
- if(request[:request].body_stream && request[:request].body_stream.respond_to?(:pos))
- begin
- request[:request].body_stream.pos = 0
- rescue Exception => e
- @logger.warn("Retry may fail due to unable to reset the file pointer" +
- " -- #{self.class.name} : #{e.inspect}")
- end
- end
else
@aws.logger.info("##### Retry ##{@retries} is being performed due to a redirect. ####")
end
+
+ # Always make sure that the fp is set to point to the beginning(?)
+ # of the File/IO. TODO: it assumes that offset is 0, which is bad.
+ if(request[:request].body_stream && request[:request].body_stream.respond_to?(:pos))
+ begin
+ request[:request].body_stream.pos = 0
+ rescue Exception => e
+ @logger.warn("Retry may fail due to unable to reset the file pointer" +
+ " -- #{self.class.name} : #{e.inspect}")
+ end
+ end
+
result = @aws.request_info(request, @parser)
else
@aws.logger.warn("##### Ooops, time is over... ####")
View
@@ -81,9 +81,19 @@ class Ec2 < RightAwsBase
# Amazon EC2 Instance Types : http://www.amazon.com/b?ie=UTF8&node=370375011
# Default EC2 instance type (platform)
DEFAULT_INSTANCE_TYPE = 'm1.small'
- INSTANCE_TYPES = ['t1.micro','m1.small','c1.medium','m1.large','m1.xlarge',
- 'c1.xlarge', 'm2.xlarge', 'm2.2xlarge', 'm2.4xlarge',
- 'cc1.4xlarge', 'cg1.4xlarge']
+ INSTANCE_TYPES = [ 't1.micro' ,
+ 'm1.small' ,
+ 'm1.medium' ,
+ 'm1.large' ,
+ 'm1.xlarge' ,
+ 'c1.medium' ,
+ 'c1.xlarge' ,
+ 'm2.xlarge' ,
+ 'm2.2xlarge',
+ 'm2.4xlarge',
+ 'cc1.4xlarge',
+ 'cg1.4xlarge',
+ 'cc2.8xlarge']
@@bench = AwsBenchmarkingBlock.new
def self.bench_xml
@@ -377,10 +377,15 @@ def edit_security_group(action, group_name, params)
when :revoke, :remove then action = "RevokeSecurityGroupIngress"
else raise "Unknown action #{action.inspect}!"
end
- hash['GroupName'] = group_name
- hash['SourceSecurityGroupName'] = params[:source_group] unless params[:source_group].right_blank?
- hash['SourceSecurityGroupOwnerId'] = params[:source_group_owner].to_s.gsub(/-/,'') unless params[:source_group_owner].right_blank?
- hash['IpProtocol'] = params[:protocol] unless params[:protocol].right_blank?
+ hash['GroupName'] = group_name
+ hash['SourceSecurityGroupName'] = params[:source_group] unless params[:source_group].right_blank?
+ hash['IpProtocol'] = params[:protocol] unless params[:protocol].right_blank?
+ unless params[:source_group_owner].right_blank?
+ # Do remove dashes only if the source owner is in format of "7011-0219-8268"
+ source_group_owner = params[:source_group_owner].to_s
+ source_group_owner.gsub!(/-/,'') if source_group_owner[/^\d{4}-\d{4}-\d{4}$/]
+ hash['SourceSecurityGroupOwnerId'] = source_group_owner
+ end
unless params[:port].right_blank?
hash['FromPort'] = params[:port]
hash['ToPort'] = params[:port]

0 comments on commit 2701199

Please sign in to comment.