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:
parent
6c22118fa5
commit
09818f2c6d
1 changed files with 18 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue