1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

add methods for server ipv4 and ipv6 public addresses

This commit is contained in:
bryanl 2015-09-28 12:22:27 -07:00
parent 8fa6a4561b
commit e2873afb84

View file

@ -30,8 +30,18 @@ module Fog
attribute :ssh_keys
def public_ip_address
if (pub_net = networks['v4'].find { |n| n['type'] == 'public' })
pub_net['ip_address']
ipv4_address
end
def ipv6_address
if (net = networks['v6'].find { |n| n['type'] == 'public' })
net['ip_address']
end
end
def ipv4_address
if (net = networks['v4'].find { |n| n['type'] == 'public' })
net['ip_address']
end
end