From 5d1b187c2da44bccfc4f1f84f0e625ee0dfaa871 Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Thu, 15 Dec 2016 01:01:57 +0100 Subject: [PATCH] Make hound happy (cherry picked from commit 1442925a4d2c31098ecd966016825c51e453b87f) (cherry picked from commit b6b44c3f1aed24e237e10a282fdf46823f2e6eda) --- crowbar_framework/app/controllers/barclamp_controller.rb | 4 +++- crowbar_framework/app/models/crowbar_service.rb | 7 ++++++- crowbar_framework/app/models/service_object.rb | 4 +++- crowbar_framework/lib/crowbar/deployment_queue.rb | 7 ++++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/crowbar_framework/app/controllers/barclamp_controller.rb b/crowbar_framework/app/controllers/barclamp_controller.rb index 075466cc9e..59e75a9678 100644 --- a/crowbar_framework/app/controllers/barclamp_controller.rb +++ b/crowbar_framework/app/controllers/barclamp_controller.rb @@ -626,7 +626,9 @@ def proposal_update @proposal["deployment"][params[:barclamp]] = JSON.parse(params[:proposal_deployment]) @service_object.save_proposal!(@proposal) # validation already happened on save - answer = @service_object.proposal_commit(params[:name], validate: false, validate_after_save: false) + answer = @service_object.proposal_commit(params[:name], + validate: false, + validate_after_save: false) flash[:alert] = answer[1] if answer[0] >= 400 flash[:notice] = answer[1] if answer[0] >= 300 and answer[0] < 400 flash[:notice] = t("barclamp.proposal_show.commit_proposal_success") if answer[0] == 200 diff --git a/crowbar_framework/app/models/crowbar_service.rb b/crowbar_framework/app/models/crowbar_service.rb index 44d220113f..8b23b9efb8 100644 --- a/crowbar_framework/app/models/crowbar_service.rb +++ b/crowbar_framework/app/models/crowbar_service.rb @@ -45,7 +45,12 @@ def role_constraints # Unfortunatelly we need to explicitely look at crowbar-status of the proposal # because apply_role from this model ignores errors from superclass's apply_role. def commit_and_check_proposal - answer = proposal_commit("default", in_queue: false, validate: false, validate_after_save: false) + answer = proposal_commit( + "default", + in_queue: false, + validate: false, + validate_after_save: false + ) # check if error message is saved in one of the nodes if answer.first != 200 found_errors = [] diff --git a/crowbar_framework/app/models/service_object.rb b/crowbar_framework/app/models/service_object.rb index 0cb33051ed..1b973d8196 100644 --- a/crowbar_framework/app/models/service_object.rb +++ b/crowbar_framework/app/models/service_object.rb @@ -569,7 +569,9 @@ def proposal_commit(inst, options = {}) begin # Put mark on the wall prop["deployment"][@bc_name]["crowbar-committing"] = true - save_proposal!(prop, validate: options[:validate], validate_after_save: options[:validate_after_save]) + save_proposal!(prop, + validate: options[:validate], + validate_after_save: options[:validate_after_save]) response = active_update(prop.raw_data, inst, options[:in_queue]) rescue Chef::Exceptions::ValidationFailed => e @logger.error ([e.message] + e.backtrace).join("\n") diff --git a/crowbar_framework/lib/crowbar/deployment_queue.rb b/crowbar_framework/lib/crowbar/deployment_queue.rb index d63fbafd26..029438c60b 100644 --- a/crowbar_framework/lib/crowbar/deployment_queue.rb +++ b/crowbar_framework/lib/crowbar/deployment_queue.rb @@ -202,7 +202,12 @@ def commit_proposal(bc, inst) service = eval("#{bc.camelize}Service.new logger") # This will call apply_role and chef-client. - status, message = service.proposal_commit(inst, in_queue: true, validate: false, validate_after_save: false) + status, message = service.proposal_commit( + inst, + in_queue: true, + validate: false, + validate_after_save: false + ) logger.debug("process queue: committed item #{bc}:#{inst}: results = #{message.inspect}")