From efdf19fb07d87c12e029651b627db44815d65f26 Mon Sep 17 00:00:00 2001 From: geemus Date: Tue, 17 Aug 2010 08:45:18 -0700 Subject: [PATCH] a little post-patch cleanup --- README.rdoc | 9 --------- lib/fog/aws/models/ec2/server.rb | 4 ++-- lib/fog/aws/requests/ec2/run_instances.rb | 4 ++-- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/README.rdoc b/README.rdoc index 89374a24d..447860a8f 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,14 +1,5 @@ http://geemus.com/fog.png -= VIRTUAL PRIVATE CLOUD ON AMAZON: - -This version of fog has been modified to support Amazon's virtual private cloud. It is based on v0.2.22 (which was available at the time). It should be regarded as experimental. We have made a pull request to the fog maintainers. This patch was uploaded to Github on 17 August 2010. - -= CHANGES FOR VPC COMPATIBILITY: - -* Introduction of a subnet parameter (to define which subnet_id the virtual private instance will run on) -* Remove security groups from the EC2 API request when there is a subnet_id present - fog is the Ruby cloud computing library. The quick and dirty, top to bottom: diff --git a/lib/fog/aws/models/ec2/server.rb b/lib/fog/aws/models/ec2/server.rb index 70de2099d..11d925ff3 100644 --- a/lib/fog/aws/models/ec2/server.rb +++ b/lib/fog/aws/models/ec2/server.rb @@ -58,7 +58,7 @@ module Fog end # def security_group - # connection.security_groups.all(@group_id) + # connection.security_groups.all(@group_id) # end # # def security_group=(new_security_group) @@ -129,7 +129,7 @@ module Fog 'UserData' => @user_data } - # If subnet is defined we are working on a virtual private cloud + # If subnet is defined we are working on a virtual private cloud. # subnet & security group cannot co-exist. I wish VPC just ignored # the security group parameter instead, it would be much easier! if subnet_id.blank? diff --git a/lib/fog/aws/requests/ec2/run_instances.rb b/lib/fog/aws/requests/ec2/run_instances.rb index 24f42e1f2..ff7b09fcc 100644 --- a/lib/fog/aws/requests/ec2/run_instances.rb +++ b/lib/fog/aws/requests/ec2/run_instances.rb @@ -26,7 +26,7 @@ module Fog # * 'Ebs.SnapshotId'<~String> - id of snapshot to boot volume from # * 'Ebs.VolumeSize'<~String> - size of volume in GiBs required unless snapshot is specified # * 'Ebs.DeleteOnTermination'<~String> - specifies whether or not to delete the volume on instance termination - # * 'SecurityGroup'<~Array> or <~String> - Name of security group(s) for instances + # * 'SecurityGroup'<~Array> or <~String> - Name of security group(s) for instances (you must omit this parameter if using Virtual Private Clouds) # * 'InstanceInitiatedShutdownBehaviour'<~String> - specifies whether volumes are stopped or terminated when instance is shutdown # * 'InstanceType'<~String> - Type of instance to boot. Valid options # in ['m1.small', 'm1.large', 'm1.xlarge', 'c1.medium', 'c1.xlarge', 'm2.2xlarge', 'm2.4xlarge'] @@ -86,7 +86,7 @@ module Fog end end end - if security_groups = [*options.delete('SecurityGroup')] # cannot use Security Groups on Virtual Private Clouds + if security_groups = [*options.delete('SecurityGroup')] options.merge!(AWS.indexed_param('SecurityGroup', security_groups)) end if options['UserData']