diff --git a/lib/fog/compute/models/bluebox/server.rb b/lib/fog/compute/models/bluebox/server.rb index fc18694e1..24fca51f2 100644 --- a/lib/fog/compute/models/bluebox/server.rb +++ b/lib/fog/compute/models/bluebox/server.rb @@ -17,7 +17,7 @@ module Fog attribute :image_id attribute :ips attribute :memory - attribute :status + attribute :state, :aliases => :status attribute :storage attribute :template @@ -73,7 +73,7 @@ module Fog end def ready? - status == 'running' + self.state == 'running' end def reboot(type = 'SOFT') diff --git a/lib/fog/compute/models/brightbox/server.rb b/lib/fog/compute/models/brightbox/server.rb index 2dfb9b5b2..d401ea8ee 100644 --- a/lib/fog/compute/models/brightbox/server.rb +++ b/lib/fog/compute/models/brightbox/server.rb @@ -10,19 +10,19 @@ module Fog attribute :url attribute :name - attribute :status + attribute :state, :aliases => 'status' attribute :hostname - attribute :created_at, :type => :time - attribute :deleted_at, :type => :time - attribute :started_at, :type => :time + attribute :created_at, :type => :time + attribute :deleted_at, :type => :time + attribute :started_at, :type => :time attribute :user_data attribute :resource_type - attribute :account_id, :aliases => "account", :squash => "id" - attribute :image_id, :aliases => "image", :squash => "id" - attribute :flavor_id, :aliases => "server_type", :squash => "id" - attribute :zone_id, :aliases => "zone", :squash => "id" + attribute :account_id, :aliases => "account", :squash => "id" + attribute :image_id, :aliases => "image", :squash => "id" + attribute :flavor_id, :aliases => "server_type", :squash => "id" + attribute :zone_id, :aliases => "zone", :squash => "id" attribute :snapshots attribute :cloud_ips @@ -86,7 +86,7 @@ module Fog end def ready? - status == 'active' + self.state == 'active' end def activate_console diff --git a/lib/fog/compute/models/rackspace/server.rb b/lib/fog/compute/models/rackspace/server.rb index da477a7f0..121e4e4b1 100644 --- a/lib/fog/compute/models/rackspace/server.rb +++ b/lib/fog/compute/models/rackspace/server.rb @@ -16,7 +16,7 @@ module Fog attribute :name attribute :personality attribute :progress - attribute :status + attribute :state, :aliases => 'status' attr_reader :password attr_writer :private_key, :private_key_path, :public_key, :public_key_path, :username @@ -75,7 +75,7 @@ module Fog end def ready? - status == 'ACTIVE' + self.state == 'ACTIVE' end def reboot(type = 'SOFT') diff --git a/lib/fog/compute/models/slicehost/server.rb b/lib/fog/compute/models/slicehost/server.rb index 6f5b9739e..3430bdf29 100644 --- a/lib/fog/compute/models/slicehost/server.rb +++ b/lib/fog/compute/models/slicehost/server.rb @@ -16,7 +16,7 @@ module Fog attribute :image_id, :aliases => 'image-id' attribute :name attribute :progress - attribute :status + attribute :state, :aliases => 'status' attr_accessor :password alias_method :'root-password=', :password= @@ -71,7 +71,7 @@ module Fog end def ready? - status == 'active' + self.state == 'active' end def reboot(type = 'SOFT') diff --git a/lib/fog/compute/models/voxel/server.rb b/lib/fog/compute/models/voxel/server.rb index d348c14dc..bb281de33 100644 --- a/lib/fog/compute/models/voxel/server.rb +++ b/lib/fog/compute/models/voxel/server.rb @@ -32,7 +32,7 @@ module Fog end def ready? - status == 'SUCCEEDED' + self.state == 'SUCCEEDED' end def private_ip_address @@ -49,8 +49,8 @@ module Fog true end - def status - @status ||= connection.voxcloud_status(id).body['devices'].first['status'] + def state + @state ||= connection.voxcloud_status(id).body['devices'].first['status'] end def save diff --git a/tests/compute/requests/rackspace/resize_tests.rb b/tests/compute/requests/rackspace/resize_tests.rb index 82f193f29..fde5fe845 100644 --- a/tests/compute/requests/rackspace/resize_tests.rb +++ b/tests/compute/requests/rackspace/resize_tests.rb @@ -14,12 +14,12 @@ Shindo.tests('Rackspace::Compute | resize request', ['rackspace']) do Rackspace[:compute].resize_server(@revert_server.id, 2) end - @confirm_server.wait_for { status == 'VERIFY_RESIZE' } + @confirm_server.wait_for { state == 'VERIFY_RESIZE' } tests("#confirm_resized_server(#{@confirm_server.id})").succeeds do Rackspace[:compute].confirm_resized_server(@confirm_server.id) end - @revert_server.wait_for { status == 'VERIFY_RESIZE' } + @revert_server.wait_for { state == 'VERIFY_RESIZE' } tests("#revert_resized_server(#{@revert_server.id})").succeeds do Rackspace[:compute].revert_resized_server(@revert_server.id) end diff --git a/tests/helpers/compute/server_helper.rb b/tests/helpers/compute/server_helper.rb index 95ada1215..1dc7b6f9c 100644 --- a/tests/helpers/compute/server_helper.rb +++ b/tests/helpers/compute/server_helper.rb @@ -3,6 +3,7 @@ def server_tests(connection, params = {}, mocks_implemented = true) model_tests(connection.servers, params, mocks_implemented) do tests('#reload').returns(true) do + pending if Fog.mocking? && !mocks_implemented identity = @instance.identity !identity.nil? && identity == @instance.reload.identity end diff --git a/tests/helpers/model_helper.rb b/tests/helpers/model_helper.rb index bda1fbf51..ff1fca2dc 100644 --- a/tests/helpers/model_helper.rb +++ b/tests/helpers/model_helper.rb @@ -2,9 +2,7 @@ def model_tests(collection, params = {}, mocks_implemented = true) tests('success') do - if !Fog.mocking? || mocks_implemented - @instance = collection.new(params) - end + @instance = collection.new(params) tests("#save").succeeds do pending if Fog.mocking? && !mocks_implemented