From b24877b9ed52d61893b46cc5dd8fd14a1daa4555 Mon Sep 17 00:00:00 2001 From: Paul Thornthwaite Date: Sat, 22 Dec 2012 23:22:08 +0000 Subject: [PATCH] [voxel|compute] Updates reference to service --- lib/fog/voxel/models/compute/images.rb | 4 ++-- lib/fog/voxel/models/compute/server.rb | 10 +++++----- lib/fog/voxel/models/compute/servers.rb | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/fog/voxel/models/compute/images.rb b/lib/fog/voxel/models/compute/images.rb index 222bca33d..8eaa3fad8 100644 --- a/lib/fog/voxel/models/compute/images.rb +++ b/lib/fog/voxel/models/compute/images.rb @@ -10,12 +10,12 @@ module Fog model Fog::Compute::Voxel::Image def all - data = connection.images_list.body['images'] + data = service.images_list.body['images'] load(data) end def get(image_id) - data = connection.images_list(image_id).body['images'] + data = service.images_list(image_id).body['images'] if data.empty? nil diff --git a/lib/fog/voxel/models/compute/server.rb b/lib/fog/voxel/models/compute/server.rb index cefa6758b..c55d1e58b 100644 --- a/lib/fog/voxel/models/compute/server.rb +++ b/lib/fog/voxel/models/compute/server.rb @@ -22,13 +22,13 @@ module Fog def destroy requires :id - connection.voxcloud_delete(id) + service.voxcloud_delete(id) true end def image requires :image_id - connection.images.get(image_id) + service.images.get(image_id) end def ready? @@ -45,19 +45,19 @@ module Fog def reboot requires :id - connection.devices_power(id, :reboot) + service.devices_power(id, :reboot) true end def state - @state ||= connection.voxcloud_status(id).body['devices'].first['status'] + @state ||= service.voxcloud_status(id).body['devices'].first['status'] end def save raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted? requires :name, :image_id, :processing_cores, :facility, :disk_size - data = connection.voxcloud_create({ + data = service.voxcloud_create({ :disk_size => disk_size, :facility => facility, :hostname => name, diff --git a/lib/fog/voxel/models/compute/servers.rb b/lib/fog/voxel/models/compute/servers.rb index 7f4e43317..f2cefa87a 100644 --- a/lib/fog/voxel/models/compute/servers.rb +++ b/lib/fog/voxel/models/compute/servers.rb @@ -9,12 +9,12 @@ module Fog model Fog::Compute::Voxel::Server def all - data = connection.devices_list.body['devices'].select {|device| device['type']['id'] == '3'} + data = service.devices_list.body['devices'].select {|device| device['type']['id'] == '3'} load(data) end def get(device_id) - if device_id && server = connection.devices_list(device_id).body['devices'] + if device_id && server = service.devices_list(device_id).body['devices'] new(server.first) end rescue Fog::Service::Error => error