Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

workaround for non-recallable security groups. Not well tested, pleas…

…e review
  • Loading branch information...
commit 7fc01f3b75fd04a6f1ec3d935ecabb8f2d6b97fa 1 parent 5198478
Philip (flip) Kromer authored
Showing with 11 additions and 5 deletions.
  1. +8 −0 lib/ironfan/dsl/ec2.rb
  2. +3 −5 lib/ironfan/provider/ec2/machine.rb
View
8 lib/ironfan/dsl/ec2.rb
@@ -118,6 +118,14 @@ def receive_provider(obj)
end
end
+ def security_group_ids
+ security_groups.keys.map do |gg|
+ security_group = Ironfan::Provider::Ec2::SecurityGroup.recall( Ironfan::Provider::Ec2::SecurityGroup.group_name_with_vpc(gg, vpc) )
+ if security_group.blank? then warn "Missing security group #{gg} -- this is a known issue on VPC instances, and deserves your attention." ; next ; end
+ security_group.group_id
+ end.compact
+ end
+
class SecurityGroup < Ironfan::Dsl
field :name, String
field :group_authorized, Array, :default => []
View
8 lib/ironfan/provider/ec2/machine.rb
@@ -72,7 +72,7 @@ def to_display(style,values={})
# style == :minimal
values["State"] = state.to_sym
values["MachineID"] = id
- values["Public IP"] = public_ip_address
+ values["Public IP"] = public_ip_address
values["Private IP"] = private_ip_address
values["Created On"] = created_at.to_date
return values if style == :minimal
@@ -163,7 +163,7 @@ def self.create!(computer)
fog_server.wait_for { ready? }
end
-
+
# tag the computer correctly
tags = {
'cluster' => computer.server.cluster_name,
@@ -239,9 +239,7 @@ def self.launch_description(computer)
}
# VPC security_groups can only be addressed by id (not name)
- description[:security_group_ids] = cloud.security_groups.keys.map do |g|
- SecurityGroup.recall( SecurityGroup.group_name_with_vpc(g,cloud.vpc) ).group_id
- end
+ description[:security_group_ids] = cloud.security_group_ids
description[:iam_server_certificates] = cloud.iam_server_certificates.values.map do |cert|
IamServerCertificate.recall(IamServerCertificate.full_name(computer, cert))
Please sign in to comment.
Something went wrong with that request. Please try again.