CID-515: check launch_options param

This commit is contained in:
Anton Chuchkalov 2016-04-22 14:45:19 +03:00
parent a37ddc9fb3
commit 732d48833f

View File

@ -11,6 +11,10 @@ module Devops
env_name = check_string(@body["deploy_env"], "Parameter 'deploy_env' must be a not empty string")
check_string(@body["name"], "Parameter 'name' must be a not empty string", true, false)
list = check_array(@body["run_list"], "Parameter 'run_list' is invalid, it should be not empty array of strings", String, true, true)
check_param(@body['launch_options'], Hash, "Parameter 'launch_options' should be a hash with 'without_bootstrap' and 'skip_rollback' keys")
if !@body['launch_options'].key?('without_bootstrap') || !@body['launch_options'].key?('skip_rollback')
raise Devops::ValidationError.new("Parameter 'launch_options' should contain 'without_bootstrap' and 'skip_rollback' keys")
end
Validators::Helpers::RunList.new(list).validate! unless list.nil?
@body
end