Add backtrace formating method
This commit is contained in:
parent
bb2c5d1ea5
commit
3c3dbf8538
|
@ -18,6 +18,7 @@ require 'json'
|
||||||
require 'logger'
|
require 'logger'
|
||||||
require 'shellwords'
|
require 'shellwords'
|
||||||
|
|
||||||
|
require 'astute/ext/exception'
|
||||||
require 'astute/config'
|
require 'astute/config'
|
||||||
require 'astute/logparser'
|
require 'astute/logparser'
|
||||||
require 'astute/orchestrator'
|
require 'astute/orchestrator'
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
# Copyright 2013 Mirantis, Inc.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
|
||||||
|
|
||||||
|
class Exception
|
||||||
|
def format_backtrace
|
||||||
|
backtrace.join("\n")
|
||||||
|
end
|
||||||
|
end
|
|
@ -188,7 +188,7 @@ module Astute
|
||||||
begin
|
begin
|
||||||
Astute::RedhatChecker.new(ctx, credentials).check_redhat_credentials
|
Astute::RedhatChecker.new(ctx, credentials).check_redhat_credentials
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
Astute.logger.error("Error #{e.message} traceback #{e.backtrace.inspect}")
|
Astute.logger.error("Error #{e.message} traceback #{e.format_backtrace}")
|
||||||
raise StopIteration
|
raise StopIteration
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -198,7 +198,7 @@ module Astute
|
||||||
begin
|
begin
|
||||||
Astute::RedhatChecker.new(ctx, credentials).check_redhat_licenses(nodes)
|
Astute::RedhatChecker.new(ctx, credentials).check_redhat_licenses(nodes)
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
Astute.logger.error("Error #{e.message} traceback #{e.backtrace.inspect}")
|
Astute.logger.error("Error #{e.message} traceback #{e.format_backtrace}")
|
||||||
raise StopIteration
|
raise StopIteration
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue