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:
parent
3ea1cd5c4d
commit
a092b0ad17
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user