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

Merge pull request #1417 from brightbox/add_dns_name

[Brightbox] Adds #dns_name to server
This commit is contained in:
Paul Thornthwaite 2012-12-23 20:14:49 -08:00
commit 2e83766a55
2 changed files with 29 additions and 0 deletions

View file

@ -129,6 +129,14 @@ module Fog
connection.images.get(image_id)
end
# Returns the public DNS name of the server
#
# @return [String]
#
def dns_name
["public", fqdn].join(".")
end
def private_ip_address
unless interfaces.empty?
interfaces.first["ipv4_address"]

View file

@ -0,0 +1,21 @@
Shindo.tests("Fog::Compute[:brightbox] | Server model", ["brightbox"]) do
pending if Fog.mocking?
tests("success") do
unless Fog.mocking?
@server = Brightbox::Compute::TestSupport.get_test_server
server_id = @server.id
end
tests("#dns_name") do
pending if Fog.mocking?
returns("public.#{@server.fqdn}") { @server.dns_name }
end
unless Fog.mocking?
@server.destroy
end
end
end