* rescue StandartError instead of Exception;
* small refactoring reboot_events private method.
This commit is contained in:
parent
ba1c303b72
commit
1014d7602d
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user