* 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
|
begin
|
||||||
@ctx.deploy_log_parser.prepare(nodes_to_deploy)
|
@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}"
|
Astute.logger.warn "Some error occurred when prepare LogParser: #{e.message}, trace: #{e.format_backtrace}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ module Astute
|
|||||||
path = ERB.new(erb_path).result(binding())
|
path = ERB.new(erb_path).result(binding())
|
||||||
begin
|
begin
|
||||||
progress = (get_log_progress(path, node_pattern_spec)*100).to_i # Return percent of progress
|
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}"
|
Astute.logger.warn "Some error occurred when calculate progress for node '#{uid}': #{e.message}, trace: #{e.format_backtrace}"
|
||||||
progress = 0
|
progress = 0
|
||||||
end
|
end
|
||||||
|
@ -194,7 +194,7 @@ module Astute
|
|||||||
rescue Astute::RedhatCheckingError => e
|
rescue Astute::RedhatCheckingError => e
|
||||||
Astute.logger.error("Error #{e.message}")
|
Astute.logger.error("Error #{e.message}")
|
||||||
raise e
|
raise e
|
||||||
rescue Exception => e
|
rescue => e
|
||||||
Astute.logger.error("Unexpected error #{e.message} traceback #{e.format_backtrace}")
|
Astute.logger.error("Unexpected error #{e.message} traceback #{e.format_backtrace}")
|
||||||
raise e
|
raise e
|
||||||
end
|
end
|
||||||
@ -207,7 +207,7 @@ module Astute
|
|||||||
rescue Astute::RedhatCheckingError => e
|
rescue Astute::RedhatCheckingError => e
|
||||||
Astute.logger.error("Error #{e.message}")
|
Astute.logger.error("Error #{e.message}")
|
||||||
raise e
|
raise e
|
||||||
rescue Exception => e
|
rescue => e
|
||||||
Astute.logger.error("Unexpected error #{e.message} traceback #{e.format_backtrace}")
|
Astute.logger.error("Unexpected error #{e.message} traceback #{e.format_backtrace}")
|
||||||
raise e
|
raise e
|
||||||
end
|
end
|
||||||
@ -227,7 +227,7 @@ module Astute
|
|||||||
time = Time.now.to_f
|
time = Time.now.to_f
|
||||||
block.call
|
block.call
|
||||||
time = time + sleep_time - Time.now.to_f
|
time = time + sleep_time - Time.now.to_f
|
||||||
sleep (time) if time > 0
|
sleep(time) if time > 0
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_engine(engine_attrs, reporter)
|
def create_engine(engine_attrs, reporter)
|
||||||
@ -261,12 +261,10 @@ module Astute
|
|||||||
end
|
end
|
||||||
|
|
||||||
def reboot_nodes(engine, nodes)
|
def reboot_nodes(engine, nodes)
|
||||||
reboot_events = {}
|
nodes.inject({}) do |reboot_events, node|
|
||||||
nodes.each do |node|
|
|
||||||
Astute.logger.debug("Trying to reboot node: #{node['name']}")
|
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
|
end
|
||||||
reboot_events
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_reboot_nodes(engine, reboot_events)
|
def check_reboot_nodes(engine, reboot_events)
|
||||||
|
@ -146,7 +146,7 @@ module Astute
|
|||||||
nodes_progress.map! {|x| x.merge!({'status' => 'deploying'})}
|
nodes_progress.map! {|x| x.merge!({'status' => 'deploying'})}
|
||||||
nodes_to_report += nodes_progress
|
nodes_to_report += nodes_progress
|
||||||
end
|
end
|
||||||
rescue Exception => e
|
rescue => e
|
||||||
Astute.logger.warn "Some error occurred when parse logs for nodes progress: #{e.message}, "\
|
Astute.logger.warn "Some error occurred when parse logs for nodes progress: #{e.message}, "\
|
||||||
"trace: #{e.format_backtrace}"
|
"trace: #{e.format_backtrace}"
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user