diff --git a/lib/astute/deployment_engine/nailyfact.rb b/lib/astute/deployment_engine/nailyfact.rb index 5888ab8c..f0e5f657 100644 --- a/lib/astute/deployment_engine/nailyfact.rb +++ b/lib/astute/deployment_engine/nailyfact.rb @@ -42,7 +42,7 @@ class Astute::DeploymentEngine::NailyFact < Astute::DeploymentEngine begin @ctx.deploy_log_parser.prepare(nodes_to_deploy) - rescue Exception => e + rescue => e Astute.logger.warn "Some error occurred when prepare LogParser: #{e.message}, trace: #{e.format_backtrace}" end diff --git a/lib/astute/logparser.rb b/lib/astute/logparser.rb index eaf25729..15521cc8 100644 --- a/lib/astute/logparser.rb +++ b/lib/astute/logparser.rb @@ -146,7 +146,7 @@ module Astute path = ERB.new(erb_path).result(binding()) begin progress = (get_log_progress(path, node_pattern_spec)*100).to_i # Return percent of progress - rescue Exception => e + rescue => e Astute.logger.warn "Some error occurred when calculate progress for node '#{uid}': #{e.message}, trace: #{e.format_backtrace}" progress = 0 end diff --git a/lib/astute/orchestrator.rb b/lib/astute/orchestrator.rb index 945936af..17ae090c 100644 --- a/lib/astute/orchestrator.rb +++ b/lib/astute/orchestrator.rb @@ -194,7 +194,7 @@ module Astute rescue Astute::RedhatCheckingError => e Astute.logger.error("Error #{e.message}") raise e - rescue Exception => e + rescue => e Astute.logger.error("Unexpected error #{e.message} traceback #{e.format_backtrace}") raise e end @@ -207,7 +207,7 @@ module Astute rescue Astute::RedhatCheckingError => e Astute.logger.error("Error #{e.message}") raise e - rescue Exception => e + rescue => e Astute.logger.error("Unexpected error #{e.message} traceback #{e.format_backtrace}") raise e end @@ -227,7 +227,7 @@ module Astute time = Time.now.to_f block.call time = time + sleep_time - Time.now.to_f - sleep (time) if time > 0 + sleep(time) if time > 0 end def create_engine(engine_attrs, reporter) @@ -261,12 +261,10 @@ module Astute end def reboot_nodes(engine, nodes) - reboot_events = {} - nodes.each do |node| + nodes.inject({}) do |reboot_events, node| Astute.logger.debug("Trying to reboot node: #{node['name']}") - reboot_events[node['name']] = engine.power_reboot(node['name']) + reboot_events.merge(node['name'] => engine.power_reboot(node['name'])) end - reboot_events end def check_reboot_nodes(engine, reboot_events) diff --git a/lib/astute/puppetd.rb b/lib/astute/puppetd.rb index 5ea38847..b151eaee 100644 --- a/lib/astute/puppetd.rb +++ b/lib/astute/puppetd.rb @@ -146,7 +146,7 @@ module Astute nodes_progress.map! {|x| x.merge!({'status' => 'deploying'})} nodes_to_report += nodes_progress end - rescue Exception => e + rescue => e Astute.logger.warn "Some error occurred when parse logs for nodes progress: #{e.message}, "\ "trace: #{e.format_backtrace}" end