Skip to content

Commit

Permalink
Display floating IP address in public IP fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Mackdanz committed Feb 19, 2014
1 parent 5a18c58 commit fe78a40
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/ironfan/provider/openstack/machine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def image_id
def groups ; Array(@adaptee.security_groups) ; end

def public_hostname ; private_ip_address ; end
def public_ip_address ; adaptee.public_ip_address || private_ip_address ; end
def dns_name ; public_ip_address ; end

def keypair ; key_pair ; end
Expand Down Expand Up @@ -117,8 +116,8 @@ def to_display(style,values={})
# style == :minimal
values["State"] = (state || "unknown").to_sym
values["MachineID"] = id
values["Public IP"] = private_ip_address
values["Private 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

Expand All @@ -143,7 +142,7 @@ def private_ip_address
end

def public_ip_address
adaptee.public_ip_address rescue nil
adaptee.floating_ip_address rescue nil
end

def to_s
Expand Down

0 comments on commit fe78a40

Please sign in to comment.