diff --git a/lib/fog/digitalocean/models/compute_v2/server.rb b/lib/fog/digitalocean/models/compute_v2/server.rb index d62544f78..d7d922dfd 100644 --- a/lib/fog/digitalocean/models/compute_v2/server.rb +++ b/lib/fog/digitalocean/models/compute_v2/server.rb @@ -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