From 853c27d1bedcfc1dc3f56b10023b8161cb7769d8 Mon Sep 17 00:00:00 2001 From: Pavol Babincak Date: Tue, 25 Aug 2015 08:11:14 -0400 Subject: [PATCH] pungi-koji: Don't print traceback if error occurred. If compose directory was created and logger setup properly traceback is written in traceback.log. Otherwise traceback is printed on stdout. --- bin/pungi-koji | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/pungi-koji b/bin/pungi-koji index fca349e8..c93c50e7 100755 --- a/bin/pungi-koji +++ b/bin/pungi-koji @@ -177,7 +177,11 @@ def main(): old_composes=opts.old_composes, koji_event=opts.koji_event, supported=opts.supported, logger=logger) kobo.log.add_file_logger(logger, compose.paths.log.log_file("global", "pungi.log")) COMPOSE = compose - run_compose(compose) + try: + run_compose(compose) + except Exception, ex: + compose.log_error("Compose run failed: %s" % ex) + raise def run_compose(compose): @@ -335,6 +339,7 @@ if __name__ == "__main__": open(tb_path, "w").write(kobo.tback.Traceback().get_traceback()) else: print("Exception: %s" % ex) + raise sys.stdout.flush() sys.stderr.flush() - raise + sys.exit(1)