diff --git a/bin/pungi-koji b/bin/pungi-koji index be3d9aaf..03eb2093 100755 --- a/bin/pungi-koji +++ b/bin/pungi-koji @@ -238,11 +238,7 @@ def main(): notifier=notifier) notifier.compose = compose COMPOSE = compose - try: - run_compose(compose, create_latest_link=create_latest_link, latest_link_status=latest_link_status) - except Exception, ex: - compose.log_error("Compose run failed: %s" % ex) - raise + run_compose(compose, create_latest_link=create_latest_link, latest_link_status=latest_link_status) def run_compose(compose, create_latest_link=True, latest_link_status=None): @@ -455,7 +451,7 @@ if __name__ == "__main__": except (Exception, KeyboardInterrupt) as ex: if COMPOSE: tb_path = COMPOSE.paths.log.log_file("global", "traceback") - COMPOSE.log_error("Exception: %s" % ex) + COMPOSE.log_error("Compose run failed: %s" % ex) COMPOSE.log_error("Extended traceback in: %s" % tb_path) COMPOSE.log_critical("Compose failed: %s" % COMPOSE.topdir) COMPOSE.write_status("DOOMED") diff --git a/pungi/gather.py b/pungi/gather.py index 4d155e5b..d6cfa7a0 100644 --- a/pungi/gather.py +++ b/pungi/gather.py @@ -663,7 +663,7 @@ class Pungi(PungiBase): self.add_package(dep, msg) added.add(dep) - except (yum.Errors.InstallError, yum.Errors.YumBaseError), ex: + except (yum.Errors.InstallError, yum.Errors.YumBaseError) as ex: self.logger.warn("Unresolvable dependency %s in %s.%s (repo: %s)" % (r, po.name, po.arch, po.repoid)) continue self.resolved_deps[req] = None diff --git a/pungi/util.py b/pungi/util.py index d25eff71..7fbc2ffb 100644 --- a/pungi/util.py +++ b/pungi/util.py @@ -68,7 +68,7 @@ def _link(local, target, logger, force=False): try: os.link(local, target) - except OSError, e: + except OSError as e: if e.errno != 18: # EXDEV logger.error('Got an error linking from cache: %s' % e) raise OSError(e) @@ -129,7 +129,7 @@ def _doCheckSum(path, hash, logger): # Try to open the file, using binary flag. try: myfile = open(path, 'rb') - except IOError, e: + except IOError as e: logger.error("Could not open file %s: %s" % (path, e)) return False