Skip to content
This repository
Browse code

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

…ment
  • Loading branch information...
commit 2701199cd014fc7698e820ecc462f947a5be19f1 2 parents a959a8c + 980ddb5
Konstantin Dzreev authored April 10, 2012
7  History.txt
@@ -339,3 +339,10 @@ the source key.
339 339
   - Fixed:
340 340
     - S3 Content-Type not set in Ruby 1.9.2
341 341
     - error in rds_interface describe_db_snapshots in Ruby 1.9.2
  342
+
  343
+
  344
+=== 3.0.4
  345
+  Release Notes:
  346
+  - Fixed:
  347
+    - #125 - fixes redirect bug in file PUT requests (Cary)
  348
+    - some other minor fixes
22  lib/awsbase/right_awsbase.rb
@@ -1101,19 +1101,21 @@ def check(request)  #:nodoc:
1101 1101
             sleep @reiteration_delay 
1102 1102
             @reiteration_delay *= 2
1103 1103
 
1104  
-            # Always make sure that the fp is set to point to the beginning(?)
1105  
-            # of the File/IO. TODO: it assumes that offset is 0, which is bad.
1106  
-            if(request[:request].body_stream && request[:request].body_stream.respond_to?(:pos))
1107  
-              begin
1108  
-                request[:request].body_stream.pos = 0
1109  
-              rescue Exception => e
1110  
-                @logger.warn("Retry may fail due to unable to reset the file pointer" +
1111  
-                             " -- #{self.class.name} : #{e.inspect}")
1112  
-              end
1113  
-            end
1114 1104
           else
1115 1105
             @aws.logger.info("##### Retry ##{@retries} is being performed due to a redirect.  ####")
1116 1106
           end
  1107
+
  1108
+          # Always make sure that the fp is set to point to the beginning(?)
  1109
+          # of the File/IO. TODO: it assumes that offset is 0, which is bad.
  1110
+          if(request[:request].body_stream && request[:request].body_stream.respond_to?(:pos))
  1111
+            begin
  1112
+              request[:request].body_stream.pos = 0
  1113
+            rescue Exception => e
  1114
+              @logger.warn("Retry may fail due to unable to reset the file pointer" +
  1115
+                           " -- #{self.class.name} : #{e.inspect}")
  1116
+            end
  1117
+          end
  1118
+
1117 1119
           result = @aws.request_info(request, @parser)
1118 1120
         else
1119 1121
           @aws.logger.warn("##### Ooops, time is over... ####")
16  lib/ec2/right_ec2.rb
@@ -81,9 +81,19 @@ class Ec2 < RightAwsBase
81 81
     # Amazon EC2 Instance Types : http://www.amazon.com/b?ie=UTF8&node=370375011
82 82
     # Default EC2 instance type (platform) 
83 83
     DEFAULT_INSTANCE_TYPE   =  'm1.small' 
84  
-    INSTANCE_TYPES          = ['t1.micro','m1.small','c1.medium','m1.large','m1.xlarge',
85  
-                               'c1.xlarge', 'm2.xlarge', 'm2.2xlarge', 'm2.4xlarge',
86  
-                               'cc1.4xlarge', 'cg1.4xlarge']
  84
+    INSTANCE_TYPES          = [  't1.micro'  ,
  85
+                                 'm1.small'  ,
  86
+                                 'm1.medium' ,
  87
+                                 'm1.large'  ,
  88
+                                 'm1.xlarge' ,
  89
+                                 'c1.medium' ,
  90
+                                 'c1.xlarge' ,
  91
+                                 'm2.xlarge' ,
  92
+                                 'm2.2xlarge',
  93
+                                 'm2.4xlarge',
  94
+                                'cc1.4xlarge',
  95
+                                'cg1.4xlarge',
  96
+                                'cc2.8xlarge']
87 97
     
88 98
     @@bench = AwsBenchmarkingBlock.new
89 99
     def self.bench_xml
13  lib/ec2/right_ec2_security_groups.rb
@@ -377,10 +377,15 @@ def edit_security_group(action, group_name, params)
377 377
       when :revoke, :remove   then action = "RevokeSecurityGroupIngress"
378 378
       else raise "Unknown action #{action.inspect}!"
379 379
       end
380  
-      hash['GroupName']                  = group_name
381  
-      hash['SourceSecurityGroupName']    = params[:source_group]                         unless params[:source_group].right_blank?
382  
-      hash['SourceSecurityGroupOwnerId'] = params[:source_group_owner].to_s.gsub(/-/,'') unless params[:source_group_owner].right_blank?
383  
-      hash['IpProtocol']                 = params[:protocol]                             unless params[:protocol].right_blank?
  380
+      hash['GroupName']               = group_name
  381
+      hash['SourceSecurityGroupName'] = params[:source_group] unless params[:source_group].right_blank?
  382
+      hash['IpProtocol']              = params[:protocol]     unless params[:protocol].right_blank?
  383
+      unless params[:source_group_owner].right_blank?
  384
+        # Do remove dashes only if the source owner is in format of "7011-0219-8268"
  385
+        source_group_owner = params[:source_group_owner].to_s
  386
+        source_group_owner.gsub!(/-/,'') if source_group_owner[/^\d{4}-\d{4}-\d{4}$/]
  387
+        hash['SourceSecurityGroupOwnerId'] = source_group_owner
  388
+      end
384 389
       unless params[:port].right_blank?
385 390
         hash['FromPort'] = params[:port]
386 391
         hash['ToPort']   = params[:port]

0 notes on commit 2701199

Please sign in to comment.
Something went wrong with that request. Please try again.