From 6a580ade702dd5c5a83ea8f029fc20925c4f6699 Mon Sep 17 00:00:00 2001 From: Clinton Wolfe Date: Wed, 17 Apr 2019 15:58:18 -0400 Subject: [PATCH] Add missing group argument in deprecator Signed-off-by: Clinton Wolfe --- lib/utils/deprecation/deprecator.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/utils/deprecation/deprecator.rb b/lib/utils/deprecation/deprecator.rb index b0b2e4a7a..e7c6c8cb3 100644 --- a/lib/utils/deprecation/deprecator.rb +++ b/lib/utils/deprecation/deprecator.rb @@ -18,7 +18,7 @@ module Inspec action = group[:action] || :warn action_method = ('handle_' + action.to_s + '_action').to_sym - send(action_method, group_name.to_sym, assembled_message) + send(action_method, group_name.to_sym, assembled_message, group) end private @@ -77,7 +77,7 @@ module Inspec end # Unused args needed for unit test deprecation harness - def handle_ignore_action(_group_name, message) + def handle_ignore_action(_group_name, message, _group) handle_log_action(message, :debug) end @@ -92,24 +92,24 @@ module Inspec end end - def handle_warn_action(_group_name, message) + def handle_warn_action(_group_name, message, _group) handle_log_action(message, :warn) end - def handle_error_action(_group_name, message) + def handle_error_action(_group_name, message, _group) handle_log_action(message, :error) end - def handle_fail_control_action(group_name, message) + def handle_fail_control_action(group_name, message, group) if called_from_control? raise Inspec::Exceptions::ResourceFailed, message else - handle_warn_action(group_name, message) + handle_warn_action(group_name, message, group) end end - def handle_exit_action(group_name, message) - handle_error_action(group_name, message) + def handle_exit_action(group_name, message, group) + handle_error_action(group_name, message, group) status = group[:exit_status] || :fatal_deprecation Inspec::UI.new.exit(status) end