Skip to content
This repository has been archived by the owner on Nov 29, 2017. It is now read-only.

Commit

Permalink
assign sg variable if security group already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
drnic committed Jan 20, 2013
1 parent 7ea5433 commit d0f8200
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/bosh-cloudfoundry/providers/aws.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ def provision_public_ip_address
# https: 443
# }
def create_security_group(security_group_name, ports)
unless fog_compute.security_groups.get(security_group_name)
unless sg = fog_compute.security_groups.get(security_group_name)
sg = fog_compute.security_groups.create(name: security_group_name, description: "microbosh")
puts "created security group #{security_group_name}"
puts "Created security group #{security_group_name}"
else
puts "reusing security group #{security_group_name}"
end
ports.each do |name, port|
sg.authorize_port_range(port..port)
puts "opened #{name} port #{port} in security group #{security_group_name}"
puts " -> opened #{name} port #{port}"
end
end

Expand Down

0 comments on commit d0f8200

Please sign in to comment.