1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[voxel|compute] cleanup parser requires

This commit is contained in:
geemus 2011-02-25 12:31:56 -08:00
parent 1bfc211758
commit 35d5d64f02
7 changed files with 18 additions and 41 deletions

View file

@ -2,6 +2,9 @@ module Fog
module Voxel
class Compute
class Real
require 'fog/compute/parsers/voxel/devices_list'
def devices_list(device_id = nil)
options = {
:parser => Fog::Parsers::Voxel::Compute::DevicesList.new,
@ -16,11 +19,6 @@ module Fog
end
end
class Mock
def devices_list( device_id = nil)
Fog::Mock.not_implemented
end
end
end
end
end

View file

@ -2,6 +2,9 @@ module Fog
module Voxel
class Compute
class Real
require 'fog/compute/parsers/voxel/basic'
def devices_power(device_id, power_action)
options = {
:device_id => device_id,
@ -14,11 +17,6 @@ module Fog
end
end
class Mock
def devices_power(device_id, power_action)
Fog::Mock.not_implemented
end
end
end
end
end

View file

@ -2,6 +2,9 @@ module Fog
module Voxel
class Compute
class Real
require 'fog/compute/parsers/voxel/images_list'
def images_list(image_id = nil)
options = {
:parser => Fog::Parsers::Voxel::Compute::ImagesList.new,
@ -23,21 +26,6 @@ module Fog
end
end
class Mock
def images_list( image_id = nil )
if image_id.nil?
@data[:images]
else
selected = @data[:images].select { |i| i['id'] == image_id }
if selected.empty?
raise Fog::Voxel::Compute::NotFound
else
selected
end
end
end
end
end
end
end

View file

@ -2,6 +2,9 @@ module Fog
module Voxel
class Compute
class Real
require 'fog/compute/parsers/voxel/voxcloud_create'
def voxcloud_create(options)
options[:parser] = Fog::Parsers::Voxel::Compute::VoxcloudCreate.new
@ -14,11 +17,6 @@ module Fog
end
end
class Mock
def voxcloud_create(options)
Fog::Mock.not_implemented
end
end
end
end
end

View file

@ -2,6 +2,9 @@ module Fog
module Voxel
class Compute
class Real
require 'fog/compute/parsers/voxel/voxcloud_delete'
def voxcloud_delete(device_id)
options = {
:device_id => device_id,
@ -12,11 +15,6 @@ module Fog
end
end
class Mock
def voxcloud_delete(device_id)
Fog::Mock.not_implemented
end
end
end
end
end

View file

@ -1,6 +1,9 @@
module Fog
module Voxel
class Compute
require 'fog/compute/parsers/voxel/voxcloud_status'
class Real
def voxcloud_status(device_id = nil)
options = {

View file

@ -64,12 +64,6 @@ module Fog
require 'time'
require 'digest/md5'
require 'fog/compute/parsers/voxel/images_list'
require 'fog/compute/parsers/voxel/devices_list'
require 'fog/compute/parsers/voxel/voxcloud_create'
require 'fog/compute/parsers/voxel/voxcloud_status'
require 'fog/compute/parsers/voxel/voxcloud_delete'
@voxel_api_key = options[:voxel_api_key]
@voxel_api_secret = options[:voxel_api_secret]