Skip to content

Commit

Permalink
:auto_elastic_ip functionality to separate it from known :elastic_ip …
Browse files Browse the repository at this point in the history
…addresses; fixing docstrings for new features. Part deaux
  • Loading branch information
JerryWJackson committed Jan 10, 2013
2 parents 2e807d9 + 7f38461 commit f2e17a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ironfan/provider/ec2/elastic_ip.rb
Expand Up @@ -58,7 +58,11 @@ def self.save!(computer)
return unless computer.created? return unless computer.created?
# instead of just returning if the elastic_ip is blank we first test if the symbol exists and whether an actual # instead of just returning if the elastic_ip is blank we first test if the symbol exists and whether an actual
# address exists in the collection; All three require the presence of elastic_ip in the facet definition. We # address exists in the collection; All three require the presence of elastic_ip in the facet definition. We
<<<<<<< HEAD
# also, for connecting to a VPC, can use allocation_id for the given :elastic_ip to attach an Elastic IP. # also, for connecting to a VPC, can use allocation_id for the given :elastic_ip to attach an Elastic IP.
=======
# also, in the case of VPC Elastic IPs, can discover and use allocation_id to attach a VPC Elastic IP.
>>>>>>> develop
return unless computer.server.ec2.include?(:elastic_ip) return unless computer.server.ec2.include?(:elastic_ip)
if ( computer.server.ec2.elastic_ip.nil? and cloud.vpc.nil? ) if ( computer.server.ec2.elastic_ip.nil? and cloud.vpc.nil? )
# First, :elastic_ip is set, no address is currently allocated for this connection's owner # First, :elastic_ip is set, no address is currently allocated for this connection's owner
Expand Down Expand Up @@ -88,7 +92,7 @@ def self.save!(computer)
Ironfan.step(computer.name, "associating Elastic IP #{elastic_ip}", :blue) Ironfan.step(computer.name, "associating Elastic IP #{elastic_ip}", :blue)
Ironfan.unless_dry_run do Ironfan.unless_dry_run do
Ironfan.safely do Ironfan.safely do
if !cloud.vpc.nil? if cloud.vpc.nil?
Ec2.connection.associate_address( computer.machine.id, public_ip = elastic_ip ) Ec2.connection.associate_address( computer.machine.id, public_ip = elastic_ip )
else else
Ec2.connection.associate_address( computer.machine.id, allocation_id = allocation_id ) Ec2.connection.associate_address( computer.machine.id, allocation_id = allocation_id )
Expand Down

0 comments on commit f2e17a6

Please sign in to comment.