diff --git a/bodhi/server/consumers/masher.py b/bodhi/server/consumers/masher.py index 3d55bbe519..d4a9971dff 100644 --- a/bodhi/server/consumers/masher.py +++ b/bodhi/server/consumers/masher.py @@ -715,7 +715,7 @@ def sanity_check_repo(self): try: repodata = os.path.join(mash_path, arch, 'repodata') sanity_check_repodata(repodata) - except Exception, e: + except Exception as e: self.log.error("Repodata sanity check failed!\n%s" % str(e)) raise diff --git a/bodhi/server/models.py b/bodhi/server/models.py index a4e49c67ec..a4dedc73af 100644 --- a/bodhi/server/models.py +++ b/bodhi/server/models.py @@ -2974,7 +2974,7 @@ def expire(self): try: koji_session.untagBuild(self.build.release.override_tag, self.build.nvr, strict=True) - except Exception, e: + except Exception as e: log.error('Unable to untag override %s: %s' % (self.build.nvr, e)) self.expired_date = datetime.utcnow() diff --git a/bodhi/server/scripts/clean_old_mashes.py b/bodhi/server/scripts/clean_old_mashes.py index 5efcd65564..8218531995 100644 --- a/bodhi/server/scripts/clean_old_mashes.py +++ b/bodhi/server/scripts/clean_old_mashes.py @@ -59,8 +59,8 @@ def clean_up(): dirs_to_delete.extend(sorted(dirs, reverse=True)[NUM_TO_KEEP:]) if dirs_to_delete: - print 'Deleting the following directories:' + print('Deleting the following directories:') for d in dirs_to_delete: d = os.path.join(mash_dir, d) shutil.rmtree(d) - print d + print(d) diff --git a/bodhi/server/validators.py b/bodhi/server/validators.py index d7cc79f86f..d85f2d3b7a 100644 --- a/bodhi/server/validators.py +++ b/bodhi/server/validators.py @@ -385,7 +385,7 @@ def validate_acls(request): release.branch, config) committers, watchers = people groups, notify_groups = groups - except Exception, e: + except Exception as e: log.exception(e) request.errors.add('body', 'builds', "Unable to access the Package " diff --git a/bodhi/tests/server/__init__.py b/bodhi/tests/server/__init__.py index 18eba0435a..604670f68b 100644 --- a/bodhi/tests/server/__init__.py +++ b/bodhi/tests/server/__init__.py @@ -48,7 +48,7 @@ def create_update(session, build_nvrs, release_name=u'F17'): update = Update( title=', '.join(build_nvrs), builds=builds, user=user, request=UpdateRequest.testing, - notes=u'Useful details!', release=release, date_submitted=datetime(1984, 11, 02), + notes=u'Useful details!', release=release, date_submitted=datetime(1984, 11, 2), requirements=u'rpmlint', stable_karma=3, unstable_karma=-3, type=UpdateType.bugfix, test_gating_status=TestGatingStatus.passed) session.add(update) diff --git a/bodhi/tests/server/consumers/test_masher.py b/bodhi/tests/server/consumers/test_masher.py index fad78e71b9..79394b1f6c 100644 --- a/bodhi/tests/server/consumers/test_masher.py +++ b/bodhi/tests/server/consumers/test_masher.py @@ -131,7 +131,7 @@ def setUp(self): req = requests.get('%s/new' % faitout) if req.status_code == 200: db_path = req.text - print 'Using faitout at: %s' % db_path + print('Using faitout at: %s' % db_path) except: pass engine = initialize_db({'sqlalchemy.url': db_path}) diff --git a/bodhi/tests/server/functional/test_comments.py b/bodhi/tests/server/functional/test_comments.py index 1eeb188036..8807295c64 100644 --- a/bodhi/tests/server/functional/test_comments.py +++ b/bodhi/tests/server/functional/test_comments.py @@ -41,7 +41,7 @@ def setUp(self, *args, **kwargs): type=UpdateType.enhancement, notes=u'Useful details!', release=release, - date_submitted=datetime(1984, 11, 02), + date_submitted=datetime(1984, 11, 2), requirements=u'rpmlint', stable_karma=3, unstable_karma=-3, @@ -379,7 +379,7 @@ def test_list_comments_by_update_no_comments(self): request=UpdateRequest.testing, type=UpdateType.enhancement, notes=u'Useful details!', - date_submitted=datetime(1984, 11, 02), + date_submitted=datetime(1984, 11, 2), requirements=u'rpmlint', stable_karma=3, unstable_karma=-3, diff --git a/bodhi/tests/server/functional/test_generic.py b/bodhi/tests/server/functional/test_generic.py index b0febd76b0..4092fc5a98 100644 --- a/bodhi/tests/server/functional/test_generic.py +++ b/bodhi/tests/server/functional/test_generic.py @@ -459,7 +459,7 @@ def _add_updates(updateslist, user, release, packagesuffix): type=j[0], notes=u'Useful details!', release=release, - date_submitted=datetime(1984, 11, 02), + date_submitted=datetime(1984, 11, 2), requirements=u'rpmlint', stable_karma=3, unstable_karma=-3, diff --git a/bodhi/tests/server/test_models.py b/bodhi/tests/server/test_models.py index 1766eeeddd..ba1fa5df5b 100644 --- a/bodhi/tests/server/test_models.py +++ b/bodhi/tests/server/test_models.py @@ -540,7 +540,7 @@ def setUp(self): request=model.UpdateRequest.testing, notes=u'Useless details!', release=model.Release.query.filter_by(name=u'F17').one(), - date_submitted=datetime(1984, 11, 02), + date_submitted=datetime(1984, 11, 2), requirements=u'rpmlint', stable_karma=3, unstable_karma=-3, @@ -1415,7 +1415,7 @@ def test_set_request_untested_stable(self): try: self.obj.set_request(self.db, UpdateRequest.stable, req.user.name) assert False - except BodhiException, e: + except BodhiException as e: pass self.assertEqual(self.obj.request, UpdateRequest.testing) self.assertEqual(self.obj.status, UpdateStatus.pending) @@ -1462,7 +1462,7 @@ def test_set_request_stable_for_critpath_update_when_test_gating_enabled(self): try: self.obj.set_request(self.db, UpdateRequest.stable, req.user.name) assert False - except BodhiException, e: + except BodhiException as e: pass expected_msg = ( 'This critical path update has not yet been approved for pushing to the ' diff --git a/tools/metrics.py b/tools/metrics.py index e5b0f1ff2e..7f3b5ebacc 100755 --- a/tools/metrics.py +++ b/tools/metrics.py @@ -60,7 +60,7 @@ def main(releases=None): total = updates.count() if not total: continue - print header(release.long_name) + print(header(release.long_name)) stats[release.name] = { 'num_updates': total, 'num_tested': 0, @@ -223,108 +223,108 @@ def main(releases=None): data['deltas'].sort() - print " * %d updates" % data['num_updates'] - print " * %d packages updated" % (len(data['packages'])) + print(" * %d updates" % data['num_updates']) + print(" * %d packages updated" % (len(data['packages']))) for status in statuses: - print " * %d %s updates" % (data['num_%s' % status], status) + print(" * %d %s updates" % (data['num_%s' % status], status)) for type in types: - print " * %d %s updates (%0.2f%%)" % ( + print(" * %d %s updates (%0.2f%%)" % ( data['num_%s' % type], type, - float(data['num_%s' % type]) / data['num_updates'] * 100) - print " * %d bugs resolved" % len(data['bugs']) - print " * %d critical path updates (%0.2f%%)" % ( - data['num_critpath'], float(data['num_critpath']) / data['num_updates'] * 100) - print " * %d approved critical path updates" % ( - data['num_critpath_approved']) - print " * %d unapproved critical path updates" % ( - data['num_critpath_unapproved']) - print " * %d updates received feedback (%0.2f%%)" % ( - data['num_feedback'], (float(data['num_feedback']) / data['num_updates'] * 100)) - print " * %d +0 comments" % data['0'] - print " * %d +1 comments" % data['1'] - print " * %d -1 comments" % data['-1'] - print " * %d unique authenticated karma submitters" % ( - len(data['karma'])) - print " * %d proventesters" % len(data['proventesters']) - print " * %d +1's from proventesters" % data['proventesters_1'] - print " * %d -1's from proventesters" % data['proventesters_-1'] + float(data['num_%s' % type]) / data['num_updates'] * 100)) + print(" * %d bugs resolved" % len(data['bugs'])) + print(" * %d critical path updates (%0.2f%%)" % ( + data['num_critpath'], float(data['num_critpath']) / data['num_updates'] * 100)) + print(" * %d approved critical path updates" % ( + data['num_critpath_approved'])) + print(" * %d unapproved critical path updates" % ( + data['num_critpath_unapproved'])) + print(" * %d updates received feedback (%0.2f%%)" % ( + data['num_feedback'], (float(data['num_feedback']) / data['num_updates'] * 100))) + print(" * %d +0 comments" % data['0']) + print(" * %d +1 comments" % data['1']) + print(" * %d -1 comments" % data['-1']) + print(" * %d unique authenticated karma submitters" % ( + len(data['karma']))) + print(" * %d proventesters" % len(data['proventesters'])) + print(" * %d +1's from proventesters" % data['proventesters_1']) + print(" * %d -1's from proventesters" % data['proventesters_-1']) if data['num_critpath']: - print " * %d critpath updates with conflicting proventesters (%0.2f%% of critpath)" % ( + print(" * %d critpath updates with conflicting proventesters (%0.2f%% of critpath)" % ( len(data['conflicted_proventesters']), - float(len(data['conflicted_proventesters'])) / data['num_critpath'] * 100) + float(len(data['conflicted_proventesters'])) / data['num_critpath'] * 100)) for u in sorted(data['conflicted_proventesters']): - print '