B #5651: Fix VMTemplate lock and unlock (#1642)

This commit is contained in:
Frederick Borges authored and GitHub committed 2021-12-02 12:11:57 +01:00
1 parent e461fc81a6
commit bc494e0cd1
1 file changed
+8 -8
@@ -33,9 +33,9 @@ module OpenNebulaJSON
end
self.allocate(template)
end
end
def perform_action(template_json)
def perform_action(template_json)
action_hash = parse_json(template_json, 'action')
if OpenNebula.is_error?(action_hash)
return action_hash
@@ -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(action_hash['params'])
when "unlock" then self.unlock(action_hash['params'])
when "lock" then self.lock_json(action_hash['params'])
when "unlock" then self.unlock_json(action_hash['params'])
else
error_msg = "#{action_hash['perform']} action not " <<
" available for this resource"
@@ -144,12 +144,12 @@ module OpenNebulaJSON
self.delete(recursive)
end
def lock(params=Hash.new)
super(params['level'].to_i)
def lock_json(params=Hash.new)
self.lock(params['level'].to_i)
end
def unlock(params=Hash.new)
super()
def unlock_json(params=Hash.new)
self.unlock
end
end
end