Permalink
Browse files

fix to allow voxcloud_create call with :password and :name vs :admin_…

…password and :hostname

bugfix in voxcloud_delete mock, devices vs servers
  • Loading branch information...
1 parent bf4ca36 commit d37397becc46ef2b5ada0d6a9867f52bf2204b3e @splaspood splaspood committed with geemus Feb 21, 2011
@@ -3,6 +3,14 @@ module Voxel
class Compute
class Real
def voxcloud_create( options )
+ options[:hostname] = options[:name]
+ options.delete(:name)
+
+ if options.has_key?(:password)
+ options[:admin_password] = options[:password]
+ options.delete(:password)
+ end
+
data = request("voxel.voxcloud.create", options)
unless data['stat'] == 'ok'
@@ -16,12 +16,12 @@ def voxcloud_delete( device_id )
class Mock
def voxcloud_delete( device_id )
- device = @data[:devices].select { |d| d[:id] == device_id }
+ device = @data[:servers].select { |d| d[:id] == device_id }
if device.empty?
raise Fog::Voxel::Compute::NotFound
else
- @data[:devices] = @data[:devices].select { |d| d[:id] != device_id }
+ @data[:servers] = @data[:servers].select { |d| d[:id] != device_id }
@data[:statuses].delete(device_id)
true
end

0 comments on commit d37397b

Please sign in to comment.