Permalink
Browse files

[voxel|compute] cleanup parser requires

  • Loading branch information...
1 parent 1bfc211 commit 35d5d64f02ec607f26fc394ea29dc2e5558e4da3 @geemus geemus committed Feb 25, 2011
@@ -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 @@ def devices_list(device_id = nil)
end
end
- class Mock
- def devices_list( device_id = nil)
- Fog::Mock.not_implemented
- end
- end
end
end
end
@@ -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 @@ def devices_power(device_id, power_action)
end
end
- class Mock
- def devices_power(device_id, power_action)
- Fog::Mock.not_implemented
- end
- end
end
end
end
@@ -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 @@ def images_list(image_id = nil)
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
@@ -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 @@ def voxcloud_create(options)
end
end
- class Mock
- def voxcloud_create(options)
- Fog::Mock.not_implemented
- end
- end
end
end
end
@@ -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 @@ def voxcloud_delete(device_id)
end
end
- class Mock
- def voxcloud_delete(device_id)
- Fog::Mock.not_implemented
- end
- end
end
end
end
@@ -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
@@ -64,12 +64,6 @@ def initialize(options = {})
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]

0 comments on commit 35d5d64

Please sign in to comment.