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:
commit
2e83766a55
2 changed files with 29 additions and 0 deletions
|
@ -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"]
|
||||
|
|
21
tests/brightbox/models/compute/server_tests.rb
Normal file
21
tests/brightbox/models/compute/server_tests.rb
Normal 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
|
Loading…
Add table
Reference in a new issue