Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1417 from brightbox/add_dns_name

[Brightbox] Adds #dns_name to server
  • Loading branch information...
commit 2e83766a55f0bb3ed4255fecfd152b26c1dbf8cd 2 parents 3c6bf2d + aa66911
@tokengeek tokengeek authored
View
8 lib/fog/brightbox/models/compute/server.rb
@@ -129,6 +129,14 @@ def image
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
21 tests/brightbox/models/compute/server_tests.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.