1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

B #5891: Fix lock/unlock action on Sunstone (#2209)

This commit is contained in:
Frederick Borges 2022-06-30 18:35:32 +02:00 committed by GitHub
parent 273ecab5cb
commit 56e4cff8f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 62 deletions

View File

@ -63,8 +63,8 @@ module OpenNebulaJSON
when "snapshot_flatten" then self.snapshot_flatten(action_hash['params'])
when "snapshot_revert" then self.snapshot_revert(action_hash['params'])
when "snapshot_delete" then self.snapshot_delete(action_hash['params'])
when "lock" then self.lock(action_hash['params'])
when "unlock" then self.unlock(action_hash['params'])
when "lock" then lock(action_hash['params']['level'].to_i)
when "unlock" then unlock()
else
error_msg = "#{action_hash['perform']} action not " <<
" available for this resource"
@ -137,13 +137,5 @@ module OpenNebulaJSON
def snapshot_delete(params=Hash.new)
super(params['snapshot_id'].to_i)
end
def lock(params=Hash.new)
super(params['level'].to_i)
end
def unlock(params=Hash.new)
super()
end
end
end

View File

@ -57,8 +57,8 @@ module OpenNebulaJSON
when "rename" then self.rename(action_hash['params'])
when "disable" then self.disable
when "enable" then self.enable
when "lock" then self.lock(action_hash['params'])
when "unlock" then self.unlock(action_hash['params'])
when "lock" then lock(action_hash['params']['level'].to_i)
when "unlock" then unlock()
when "vm.import" then self.app_vm_import(action_hash['params'])
when "vm-template.import" then self.app_vm_import(action_hash['params'])
when "service_template.import" then self.app_service_import(action_hash['params'])
@ -234,13 +234,5 @@ module OpenNebulaJSON
def rename(params=Hash.new)
super(params['name'])
end
def lock(params=Hash.new)
super(params['level'].to_i)
end
def unlock(params=Hash.new)
super()
end
end
end

View File

@ -51,8 +51,8 @@ module OpenNebulaJSON
when "clone" then self.clone(action_hash['params'])
when "rename" then self.rename(action_hash['params'])
when "delete_recursive" then self.delete_recursive(action_hash['params'])
when "lock" then self.lock_json(action_hash['params'])
when "unlock" then self.unlock_json(action_hash['params'])
when "lock" then lock(action_hash['params']['level'].to_i)
when "unlock" then unlock()
else
error_msg = "#{action_hash['perform']} action not " <<
" available for this resource"
@ -143,13 +143,5 @@ module OpenNebulaJSON
recursive = (params['recursive'] == true)
self.delete(recursive)
end
def lock_json(params=Hash.new)
self.lock(params['level'].to_i)
end
def unlock_json(params=Hash.new)
self.unlock
end
end
end

View File

@ -47,8 +47,8 @@ module OpenNebulaJSON
when "chmod" then self.chmod_octet(action_hash['params'])
when "update" then self.update(action_hash['params'])
when "rename" then self.rename(action_hash['params'])
when "lock" then self.lock(action_hash['params'])
when "unlock" then self.unlock(action_hash['params'])
when "lock" then lock(action_hash['params']['level'].to_i)
when "unlock" then unlock()
else
error_msg = "#{action_hash['perform']} action not " <<
" available for this resource"
@ -79,13 +79,5 @@ module OpenNebulaJSON
def rename(params=Hash.new)
super(params['name'])
end
def lock(params=Hash.new)
super(params['level'].to_i)
end
def unlock(params=Hash.new)
super()
end
end
end

View File

@ -59,8 +59,8 @@ module OpenNebulaJSON
when "add_ar" then self.add_ar(action_hash['params'])
when "update_ar" then self.update_ar(action_hash['params'])
when "reserve" then self.reserve(action_hash['params'])
when "lock" then self.lock(action_hash['params'])
when "unlock" then self.unlock(action_hash['params'])
when "lock" then lock(action_hash['params']['level'].to_i)
when "unlock" then unlock()
else
error_msg = "#{action_hash['perform']} action not " <<
" available for this resource"
@ -118,13 +118,5 @@ module OpenNebulaJSON
super(params['name'], params['size'], params['ar_id'],
params['addr'], params['vnet'])
end
def lock(params=Hash.new)
super(params['level'].to_i)
end
def unlock(params=Hash.new)
super()
end
end
end

View File

@ -50,8 +50,8 @@ module OpenNebulaJSON
when "hold" then self.hold(action_hash['params'])
when "release" then self.release(action_hash['params'])
when "rename" then self.rename(action_hash['params'])
when "lock" then self.lock(action_hash['params'])
when "unlock" then self.unlock(action_hash['params'])
when "lock" then lock(action_hash['params']['level'].to_i)
when "unlock" then unlock()
when "instantiate" then self.instantiate(action_hash['params'])
else
error_msg = "#{action_hash['perform']} action not " <<

View File

@ -51,8 +51,8 @@ module OpenNebulaJSON
when "rename" then self.rename(action_hash['params'])
when "attachnic" then self.nic_attach(action_hash['params'])
when "detachnic" then self.nic_detach(action_hash['params'])
when "lock" then self.lock(action_hash['params'])
when "unlock" then self.unlock(action_hash['params'])
when "lock" then lock(action_hash['params']['level'].to_i)
when "unlock" then unlock()
else
error_msg = "#{action_hash['perform']} action not " <<
" available for this resource"
@ -115,13 +115,5 @@ module OpenNebulaJSON
def nic_detach(params=Hash.new)
super(params['nic_id'].to_i)
end
def lock(params=Hash.new)
super(params['level'].to_i)
end
def unlock(params=Hash.new)
super()
end
end
end