From d4885dbe4d9cadd177021f0204bbd49d4e2e7b01 Mon Sep 17 00:00:00 2001 From: Matheus Mina Date: Wed, 11 Dec 2013 16:49:49 -0200 Subject: [PATCH] fixed consoles to use :aliases --- lib/fog/xenserver/models/compute/server.rb | 6 +++--- tests/xenserver/models/compute/server_tests.rb | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/fog/xenserver/models/compute/server.rb b/lib/fog/xenserver/models/compute/server.rb index dd7b0766b..45543c64b 100644 --- a/lib/fog/xenserver/models/compute/server.rb +++ b/lib/fog/xenserver/models/compute/server.rb @@ -14,7 +14,7 @@ module Fog attribute :name, :aliases => :name_label attribute :__affinity, :aliases => :affinity attribute :allowed_operations - attribute :consoles + attribute :__consoles, :aliases => :consoles attribute :domarch attribute :domid attribute :tags @@ -64,8 +64,8 @@ module Fog service.hosts.get __affinity end - def get_consoles - consoles.collect {|console| service.consoles.get console } + def consoles + __consoles.collect {|console| service.consoles.get console } end def destroy diff --git a/tests/xenserver/models/compute/server_tests.rb b/tests/xenserver/models/compute/server_tests.rb index 18aa5437e..eeb3f6691 100644 --- a/tests/xenserver/models/compute/server_tests.rb +++ b/tests/xenserver/models/compute/server_tests.rb @@ -31,7 +31,7 @@ Shindo.tests('Fog::Compute[:xenserver] | server model', ['xenserver']) do :is_a_template, :__affinity, :allowed_operations, - :consoles, + :__consoles, :domarch, :domid, :__guest_metrics, @@ -113,8 +113,8 @@ Shindo.tests('Fog::Compute[:xenserver] | server model', ['xenserver']) do end tests('return valid consoles') do - test('as an array') { server.get_consoles.kind_of? Array } - server.get_consoles.each { |i| + test('as an array') { server.consoles.kind_of? Array } + server.consoles.each { |i| test('and each Console should be a Fog::Compute::XenServer::Console') { i.kind_of? Fog::Compute::XenServer::Console } } end