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

[ovirt] Fix update_interface method

This commit is contained in:
Pavol Dilung 2015-03-06 12:44:15 +01:00
parent 6c22118fa5
commit 09818f2c6d

View file

@ -1,19 +1,32 @@
module Fog
module Compute
class Ovirt
class Real
def update_interface(id, options)
module Shared
def check_arguments(id, options)
raise ArgumentError, "instance id is a required parameter" unless id
raise ArgumentError, "interface id is a required parameter for update-interface" unless options.key? :id
end
end
client.update_interface(id, options)
class Real
extend ::Fog::Compute::Ovirt::Shared
def update_interface(id, options)
check_arguments(id, options)
interface_id = options[:id]
options.delete(:id)
client.update_interface(id, interface_id, options)
end
end
class Mock
extend ::Fog::Compute::Ovirt::Shared
def update_interface(id, options)
raise ArgumentError, "instance id is a required parameter" unless id
raise ArgumentError, "interface id is a required parameter for update-interface" unless options.key? :id
check_arguments(id, options)
true
end
end