Permalink
Browse files

Merge branch 'release4.0'

  • Loading branch information...
2 parents b5788c8 + 752362a commit a86c53737a46096dd7ebc06ca629c4062ecddb40 @konstantin-dzreev konstantin-dzreev committed Mar 9, 2012
Showing with 22 additions and 7 deletions.
  1. +13 −3 lib/ec2/right_ec2.rb
  2. +9 −4 lib/ec2/right_ec2_security_groups.rb
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 a86c537

Please sign in to comment.