diff --git a/tests/base.py b/tests/base.py index 585f2d203b..de5601bbb4 100755 --- a/tests/base.py +++ b/tests/base.py @@ -1296,9 +1296,8 @@ class ZuulTestCase(BaseTestCase): start = time.time() while True: if time.time() - start > 10: - print 'queue status:', - print ' '.join(self.eventQueuesEmpty()) - print self.areAllBuildsWaiting() + print('queue status:', ''.join(self.eventQueuesEmpty())) + print(self.areAllBuildsWaiting()) raise Exception("Timeout waiting for Zuul to settle") # Make sure no new events show up while we're checking self.worker.lock.acquire() @@ -1336,8 +1335,8 @@ class ZuulTestCase(BaseTestCase): for pipeline in self.sched.layout.pipelines.values(): for queue in pipeline.queues: if len(queue.queue) != 0: - print 'pipeline %s queue %s contents %s' % ( - pipeline.name, queue.name, queue.queue) + print('pipeline %s queue %s contents %s' % ( + pipeline.name, queue.name, queue.queue)) self.assertEqual(len(queue.queue), 0, "Pipelines queues should be empty") diff --git a/tests/test_layoutvalidator.py b/tests/test_layoutvalidator.py index 3dc3234a88..3de4a94d56 100644 --- a/tests/test_layoutvalidator.py +++ b/tests/test_layoutvalidator.py @@ -33,13 +33,13 @@ LAYOUT_RE = re.compile(r'^(good|bad)_.*\.yaml$') class TestLayoutValidator(testtools.TestCase): def test_layouts(self): """Test layout file validation""" - print + print() errors = [] for fn in os.listdir(os.path.join(FIXTURE_DIR, 'layouts')): m = LAYOUT_RE.match(fn) if not m: continue - print fn + print(fn) # Load any .conf file by the same name but .conf extension. config_file = ("%s.conf" % @@ -69,7 +69,7 @@ class TestLayoutValidator(testtools.TestCase): fn) except voluptuous.Invalid as e: error = str(e) - print ' ', error + print(' ', error) if error in errors: raise Exception("Error has already been tested: %s" % error) diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py index 15d33c8aad..053b1ccd33 100755 --- a/tests/test_scheduler.py +++ b/tests/test_scheduler.py @@ -1484,7 +1484,7 @@ jobs: self.worker.build_history = [] path = os.path.join(self.git_root, "org/project") - print repack_repo(path) + print(repack_repo(path)) A = self.fake_gerrit.addFakeChange('org/project', 'master', 'A') A.addApproval('CRVW', 2) @@ -1509,9 +1509,9 @@ jobs: A = self.fake_gerrit.addFakeChange('org/project1', 'master', 'A') A.addPatchset(large=True) path = os.path.join(self.upstream_root, "org/project1") - print repack_repo(path) + print(repack_repo(path)) path = os.path.join(self.git_root, "org/project1") - print repack_repo(path) + print(repack_repo(path)) A.addApproval('CRVW', 2) self.fake_gerrit.addEvent(A.addApproval('APRV', 1)) diff --git a/tools/zuul-changes.py b/tools/zuul-changes.py index 9dbf504e74..8b854c79de 100755 --- a/tools/zuul-changes.py +++ b/tools/zuul-changes.py @@ -35,7 +35,7 @@ for pipeline in data['pipelines']: if not change['live']: continue cid, cps = change['id'].split(',') - print ( + print( "zuul enqueue --trigger gerrit --pipeline %s " "--project %s --change %s,%s" % ( options.pipeline_name, diff --git a/zuul/cmd/client.py b/zuul/cmd/client.py index 59ac419f15..1ce2828f0b 100644 --- a/zuul/cmd/client.py +++ b/zuul/cmd/client.py @@ -154,7 +154,7 @@ class Client(zuul.cmd.ZuulApp): running_items = client.get_running_jobs() if len(running_items) == 0: - print "No jobs currently running" + print("No jobs currently running") return True all_fields = self._show_running_jobs_columns() @@ -181,7 +181,7 @@ class Client(zuul.cmd.ZuulApp): v += all_fields[f]['append'] values.append(v) table.add_row(values) - print table + print(table) return True def _epoch_to_relative_time(self, epoch): diff --git a/zuul/cmd/launcher.py b/zuul/cmd/launcher.py index 2ba4b85af1..bbda87dad6 100644 --- a/zuul/cmd/launcher.py +++ b/zuul/cmd/launcher.py @@ -99,7 +99,7 @@ class Launcher(zuul.cmd.ZuulApp): try: signal.pause() except KeyboardInterrupt: - print "Ctrl + C: asking launcher to exit nicely...\n" + print("Ctrl + C: asking launcher to exit nicely...\n") self.exit_handler() sys.exit(0) diff --git a/zuul/cmd/merger.py b/zuul/cmd/merger.py index df215fd80b..797a990b01 100644 --- a/zuul/cmd/merger.py +++ b/zuul/cmd/merger.py @@ -68,7 +68,7 @@ class Merger(zuul.cmd.ZuulApp): try: signal.pause() except KeyboardInterrupt: - print "Ctrl + C: asking merger to exit nicely...\n" + print("Ctrl + C: asking merger to exit nicely...\n") self.exit_handler(signal.SIGINT, None) @@ -89,9 +89,7 @@ def main(): f.close() os.unlink(test_fn) except Exception: - print - print "Unable to write to state directory: %s" % state_dir - print + print("\nUnable to write to state directory: %s\n" % state_dir) raise if server.config.has_option('merger', 'pidfile'): diff --git a/zuul/cmd/server.py b/zuul/cmd/server.py index 6db15a21d6..f4004362af 100755 --- a/zuul/cmd/server.py +++ b/zuul/cmd/server.py @@ -107,7 +107,7 @@ class Server(zuul.cmd.ZuulApp): jobs.add(v) for job in sorted(layout.jobs): if job not in jobs: - print "Job %s not defined" % job + print("Job %s not defined" % job) failure = True return failure @@ -196,7 +196,7 @@ class Server(zuul.cmd.ZuulApp): try: signal.pause() except KeyboardInterrupt: - print "Ctrl + C: asking scheduler to exit nicely...\n" + print("Ctrl + C: asking scheduler to exit nicely...\n") self.exit_handler(signal.SIGINT, None)