mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
addresses['internet'] (like on TryStack.org) supported and public and private_ip_address now work
This commit is contained in:
parent
ffedab7072
commit
5e695499b9
1 changed files with 14 additions and 2 deletions
|
@ -76,7 +76,13 @@ module Fog
|
|||
end
|
||||
|
||||
def private_ip_address
|
||||
nil
|
||||
if addresses['private']
|
||||
#assume only a single private
|
||||
return addresses['private'].first
|
||||
else
|
||||
#assume no private IP means private cloud
|
||||
return addresses['internet'].first
|
||||
end
|
||||
end
|
||||
|
||||
def private_key_path
|
||||
|
@ -89,7 +95,13 @@ module Fog
|
|||
end
|
||||
|
||||
def public_ip_address
|
||||
addresses['public'].first
|
||||
if addresses['public']
|
||||
#assume last is either original or assigned from floating IPs
|
||||
return addresses['public'].last
|
||||
else
|
||||
#assume no public IP means private cloud
|
||||
return addresses['internet'].first
|
||||
end
|
||||
end
|
||||
|
||||
def public_key_path
|
||||
|
|
Loading…
Reference in a new issue