mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
fix to allow voxcloud_create call with :password and :name vs :admin_password and :hostname
bugfix in voxcloud_delete mock, devices vs servers
This commit is contained in:
parent
bf4ca3621d
commit
d37397becc
2 changed files with 10 additions and 2 deletions
|
@ -3,6 +3,14 @@ module Fog
|
|||
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 @@ module Fog
|
|||
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue