From 732d48833f3c3e06410f53e43b71e64dfa6e2813 Mon Sep 17 00:00:00 2001 From: Anton Chuchkalov Date: Fri, 22 Apr 2016 14:45:19 +0300 Subject: [PATCH] CID-515: check launch_options param --- devops-service/app/api2/parsers/stack.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/devops-service/app/api2/parsers/stack.rb b/devops-service/app/api2/parsers/stack.rb index de1ee1c..ef1df79 100644 --- a/devops-service/app/api2/parsers/stack.rb +++ b/devops-service/app/api2/parsers/stack.rb @@ -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