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

F #4532: Minor change case/when logic

This commit is contained in:
Ruben S. Montero 2020-04-16 18:18:39 +02:00
parent 3ea1cd5c4d
commit a092b0ad17
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -296,23 +296,21 @@ post '/service/:id/action' do
# OpenNebula::Error.new("Action #{action['perform']}: " \
# 'Only supported for append')
# end
else
if Role::SCHEDULE_ACTIONS.include?(action['perform'])
# Use defaults only if one of the options is supplied
opts['period'] ||= conf[:action_period]
opts['number'] ||= conf[:action_number]
when *Role::SCHEDULE_ACTIONS
# Use defaults only if one of the options is supplied
opts['period'] ||= conf[:action_period]
opts['number'] ||= conf[:action_number]
rc = lcm.service_sched_action(@client,
params[:id],
action['perform'],
opts['period'],
opts['number'],
opts['args'])
else
rc = OpenNebula::Error.new(
"Action #{action['perform']} not supported"
)
end
rc = lcm.service_sched_action(@client,
params[:id],
action['perform'],
opts['period'],
opts['number'],
opts['args'])
else
rc = OpenNebula::Error.new(
"Action #{action['perform']} not supported"
)
end
if OpenNebula.is_error?(rc)