summaryrefslogtreecommitdiff
path: root/cbuildbot/stages
diff options
context:
space:
mode:
authorMike Frysinger <vapier@chromium.org>2014-09-16 15:06:17 -0400
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-09-18 03:01:17 +0000
commit383367e89fead21c09e22a2be3bffeeb59c99db9 (patch)
tree0b1da9807b6a427dfdfd1b84f9434643d45958cf /cbuildbot/stages
parent0c25f4039cf6368bcef0488d87016d1a02e61bf4 (diff)
downloadchromite-383367e89fead21c09e22a2be3bffeeb59c99db9.tar.gz
convert to print_function
BUG=chromium:414895 TEST=`./cbuildbot/run_tests` passes TEST=`cros lint` passes (it complains if print is used incorrectly) TEST=`cbuildbot chromiumos-sdk` passes TEST=`cbuildbot lumpy-release` passes Change-Id: I67e7e1290b03a16525e0c2b1afa74ebbd8d3508f Reviewed-on: https://chromium-review.googlesource.com/218572 Reviewed-by: David James <davidjames@chromium.org> Reviewed-by: Yu-Ju Hong <yjhong@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
Diffstat (limited to 'cbuildbot/stages')
-rw-r--r--cbuildbot/stages/afdo_stages.py2
-rw-r--r--cbuildbot/stages/artifact_stages.py2
-rwxr-xr-xcbuildbot/stages/artifact_stages_unittest.py2
-rw-r--r--cbuildbot/stages/branch_stages.py2
-rwxr-xr-xcbuildbot/stages/branch_stages_unittest.py2
-rw-r--r--cbuildbot/stages/build_stages.py2
-rwxr-xr-xcbuildbot/stages/build_stages_unittest.py2
-rw-r--r--cbuildbot/stages/chrome_stages.py6
-rwxr-xr-xcbuildbot/stages/chrome_stages_unittest.py2
-rw-r--r--cbuildbot/stages/completion_stages.py2
-rwxr-xr-xcbuildbot/stages/completion_stages_unittest.py2
-rw-r--r--cbuildbot/stages/generic_stages.py10
-rwxr-xr-xcbuildbot/stages/generic_stages_unittest.py2
-rw-r--r--cbuildbot/stages/release_stages.py2
-rwxr-xr-xcbuildbot/stages/release_stages_unittest.py2
-rw-r--r--cbuildbot/stages/report_stages.py2
-rwxr-xr-xcbuildbot/stages/report_stages_unittest.py2
-rw-r--r--cbuildbot/stages/sdk_stages.py2
-rwxr-xr-xcbuildbot/stages/sdk_stages_unittest.py2
-rwxr-xr-xcbuildbot/stages/stage_results_unittest.py2
-rw-r--r--cbuildbot/stages/sync_stages.py6
-rwxr-xr-xcbuildbot/stages/sync_stages_unittest.py2
-rw-r--r--cbuildbot/stages/test_stages.py2
-rwxr-xr-xcbuildbot/stages/test_stages_unittest.py2
24 files changed, 56 insertions, 8 deletions
diff --git a/cbuildbot/stages/afdo_stages.py b/cbuildbot/stages/afdo_stages.py
index abe69a75b..6e37b9434 100644
--- a/cbuildbot/stages/afdo_stages.py
+++ b/cbuildbot/stages/afdo_stages.py
@@ -4,6 +4,8 @@
"""Module containing the AFDO stages."""
+from __future__ import print_function
+
from chromite.cbuildbot import afdo
from chromite.cbuildbot import constants
from chromite.lib import alerts
diff --git a/cbuildbot/stages/artifact_stages.py b/cbuildbot/stages/artifact_stages.py
index 2735494e5..b6415931d 100644
--- a/cbuildbot/stages/artifact_stages.py
+++ b/cbuildbot/stages/artifact_stages.py
@@ -4,6 +4,8 @@
"""Module containing stages that generate and/or archive artifacts."""
+from __future__ import print_function
+
import glob
import itertools
import json
diff --git a/cbuildbot/stages/artifact_stages_unittest.py b/cbuildbot/stages/artifact_stages_unittest.py
index 04d2f25b2..601adaf4d 100755
--- a/cbuildbot/stages/artifact_stages_unittest.py
+++ b/cbuildbot/stages/artifact_stages_unittest.py
@@ -5,6 +5,8 @@
"""Unittests for the artifact stages."""
+from __future__ import print_function
+
import argparse
import mox
import os
diff --git a/cbuildbot/stages/branch_stages.py b/cbuildbot/stages/branch_stages.py
index 5a013d9a7..333dcac7b 100644
--- a/cbuildbot/stages/branch_stages.py
+++ b/cbuildbot/stages/branch_stages.py
@@ -4,6 +4,8 @@
"""Module containing the branch stages."""
+from __future__ import print_function
+
import logging
import os
import re
diff --git a/cbuildbot/stages/branch_stages_unittest.py b/cbuildbot/stages/branch_stages_unittest.py
index 259a30355..b7a34d9d8 100755
--- a/cbuildbot/stages/branch_stages_unittest.py
+++ b/cbuildbot/stages/branch_stages_unittest.py
@@ -5,6 +5,8 @@
"""Unittests for the branch stages."""
+from __future__ import print_function
+
import os
import sys
diff --git a/cbuildbot/stages/build_stages.py b/cbuildbot/stages/build_stages.py
index fe869e98f..d169a8d80 100644
--- a/cbuildbot/stages/build_stages.py
+++ b/cbuildbot/stages/build_stages.py
@@ -4,6 +4,8 @@
"""Module containing the build stages."""
+from __future__ import print_function
+
import functools
import glob
import os
diff --git a/cbuildbot/stages/build_stages_unittest.py b/cbuildbot/stages/build_stages_unittest.py
index 4619e0b15..b21cb3c1d 100755
--- a/cbuildbot/stages/build_stages_unittest.py
+++ b/cbuildbot/stages/build_stages_unittest.py
@@ -5,6 +5,8 @@
"""Unittests for build stages."""
+from __future__ import print_function
+
import contextlib
import os
import sys
diff --git a/cbuildbot/stages/chrome_stages.py b/cbuildbot/stages/chrome_stages.py
index b660179fc..f712276c2 100644
--- a/cbuildbot/stages/chrome_stages.py
+++ b/cbuildbot/stages/chrome_stages.py
@@ -4,6 +4,8 @@
"""Module containing the Chrome stages."""
+from __future__ import print_function
+
import multiprocessing
import platform
import os
@@ -206,8 +208,8 @@ class ChromeSDKStage(generic_stages.BoardSpecificBuilderStage,
def PerformStage(self):
if platform.dist()[-1] == 'lucid':
# Chrome no longer builds on Lucid. See crbug.com/276311
- print 'Ubuntu lucid is no longer supported.'
- print 'Please upgrade to Ubuntu Precise.'
+ print('Ubuntu lucid is no longer supported.')
+ print('Please upgrade to Ubuntu Precise.')
cros_build_lib.PrintBuildbotStepWarnings()
return
diff --git a/cbuildbot/stages/chrome_stages_unittest.py b/cbuildbot/stages/chrome_stages_unittest.py
index 6bb2633f7..424fd22eb 100755
--- a/cbuildbot/stages/chrome_stages_unittest.py
+++ b/cbuildbot/stages/chrome_stages_unittest.py
@@ -5,6 +5,8 @@
"""Unittests for chrome stages."""
+from __future__ import print_function
+
import mox
import os
import sys
diff --git a/cbuildbot/stages/completion_stages.py b/cbuildbot/stages/completion_stages.py
index a2255a60d..81c745dfe 100644
--- a/cbuildbot/stages/completion_stages.py
+++ b/cbuildbot/stages/completion_stages.py
@@ -4,6 +4,8 @@
"""Module containing the completion stages."""
+from __future__ import print_function
+
import logging
from chromite.cbuildbot import commands
diff --git a/cbuildbot/stages/completion_stages_unittest.py b/cbuildbot/stages/completion_stages_unittest.py
index 349582ec5..7db1dfec3 100755
--- a/cbuildbot/stages/completion_stages_unittest.py
+++ b/cbuildbot/stages/completion_stages_unittest.py
@@ -5,6 +5,8 @@
"""Unittests for completion stages."""
+from __future__ import print_function
+
import mox
import os
import sys
diff --git a/cbuildbot/stages/generic_stages.py b/cbuildbot/stages/generic_stages.py
index 441fa9449..71756820f 100644
--- a/cbuildbot/stages/generic_stages.py
+++ b/cbuildbot/stages/generic_stages.py
@@ -4,6 +4,8 @@
"""Module containing the generic stages."""
+from __future__ import print_function
+
import contextlib
import fnmatch
import json
@@ -173,7 +175,7 @@ class BuilderStage(object):
def _Print(self, msg):
"""Prints a msg to stderr."""
sys.stdout.flush()
- print >> sys.stderr, msg
+ print(msg, file=sys.stderr)
sys.stderr.flush()
def _PrintLoudly(self, msg):
@@ -183,7 +185,7 @@ class BuilderStage(object):
edge = '*' * 2
sys.stdout.flush()
- print >> sys.stderr, border_line
+ print(border_line, file=sys.stderr)
msg_lines = msg.split('\n')
@@ -192,9 +194,9 @@ class BuilderStage(object):
del msg_lines[-1]
for msg_line in msg_lines:
- print >> sys.stderr, '%s %s' % (edge, msg_line)
+ print('%s %s' % (edge, msg_line), file=sys.stderr)
- print >> sys.stderr, border_line
+ print(border_line, file=sys.stderr)
sys.stderr.flush()
def _GetPortageEnvVar(self, envvar, board):
diff --git a/cbuildbot/stages/generic_stages_unittest.py b/cbuildbot/stages/generic_stages_unittest.py
index 9cb2082ba..93835d3e8 100755
--- a/cbuildbot/stages/generic_stages_unittest.py
+++ b/cbuildbot/stages/generic_stages_unittest.py
@@ -5,6 +5,8 @@
"""Unittests for generic stages."""
+from __future__ import print_function
+
import contextlib
import copy
import mox
diff --git a/cbuildbot/stages/release_stages.py b/cbuildbot/stages/release_stages.py
index 9a22a78e9..a0c1f89fa 100644
--- a/cbuildbot/stages/release_stages.py
+++ b/cbuildbot/stages/release_stages.py
@@ -4,6 +4,8 @@
"""Module containing the various stages that a builder runs."""
+from __future__ import print_function
+
import json
import logging
import os
diff --git a/cbuildbot/stages/release_stages_unittest.py b/cbuildbot/stages/release_stages_unittest.py
index e165ec291..baa2ad317 100755
--- a/cbuildbot/stages/release_stages_unittest.py
+++ b/cbuildbot/stages/release_stages_unittest.py
@@ -5,6 +5,8 @@
"""Unittests for build stages."""
+from __future__ import print_function
+
import os
import sys
diff --git a/cbuildbot/stages/report_stages.py b/cbuildbot/stages/report_stages.py
index 8602486fd..751b2028c 100644
--- a/cbuildbot/stages/report_stages.py
+++ b/cbuildbot/stages/report_stages.py
@@ -4,6 +4,8 @@
"""Module containing the report stages."""
+from __future__ import print_function
+
import logging
import os
import sys
diff --git a/cbuildbot/stages/report_stages_unittest.py b/cbuildbot/stages/report_stages_unittest.py
index 28da0258f..dd3e03148 100755
--- a/cbuildbot/stages/report_stages_unittest.py
+++ b/cbuildbot/stages/report_stages_unittest.py
@@ -5,6 +5,8 @@
"""Unittests for report stages."""
+from __future__ import print_function
+
import mox
import os
import sys
diff --git a/cbuildbot/stages/sdk_stages.py b/cbuildbot/stages/sdk_stages.py
index d0cbf58c2..007f3a531 100644
--- a/cbuildbot/stages/sdk_stages.py
+++ b/cbuildbot/stages/sdk_stages.py
@@ -4,6 +4,8 @@
"""Module containing SDK stages."""
+from __future__ import print_function
+
import json
import os
diff --git a/cbuildbot/stages/sdk_stages_unittest.py b/cbuildbot/stages/sdk_stages_unittest.py
index 50be2330f..92068a8c9 100755
--- a/cbuildbot/stages/sdk_stages_unittest.py
+++ b/cbuildbot/stages/sdk_stages_unittest.py
@@ -5,6 +5,8 @@
"""Unittests for SDK stages."""
+from __future__ import print_function
+
import mox
import json
import os
diff --git a/cbuildbot/stages/stage_results_unittest.py b/cbuildbot/stages/stage_results_unittest.py
index 21a420b7a..0545920bd 100755
--- a/cbuildbot/stages/stage_results_unittest.py
+++ b/cbuildbot/stages/stage_results_unittest.py
@@ -5,6 +5,8 @@
"""Unittests for the stage results."""
+from __future__ import print_function
+
import os
import signal
import StringIO
diff --git a/cbuildbot/stages/sync_stages.py b/cbuildbot/stages/sync_stages.py
index 1cfab39e5..101daf5db 100644
--- a/cbuildbot/stages/sync_stages.py
+++ b/cbuildbot/stages/sync_stages.py
@@ -4,6 +4,8 @@
"""Module containing the sync stages."""
+from __future__ import print_function
+
import contextlib
import datetime
import logging
@@ -310,8 +312,8 @@ class SyncStage(generic_stages.BuilderStage):
if not self.skip_sync:
self.repo.Sync(next_manifest)
- print >> sys.stderr, self.repo.ExportManifest(
- mark_revision=self.output_manifest_sha1)
+ print(self.repo.ExportManifest(mark_revision=self.output_manifest_sha1),
+ file=sys.stderr)
def RunPrePatchBuild(self):
"""Run through a pre-patch build to prepare for incremental build.
diff --git a/cbuildbot/stages/sync_stages_unittest.py b/cbuildbot/stages/sync_stages_unittest.py
index eaa90cdd6..4515acdd9 100755
--- a/cbuildbot/stages/sync_stages_unittest.py
+++ b/cbuildbot/stages/sync_stages_unittest.py
@@ -5,6 +5,8 @@
"""Unittests for sync stages."""
+from __future__ import print_function
+
import cPickle
import itertools
import os
diff --git a/cbuildbot/stages/test_stages.py b/cbuildbot/stages/test_stages.py
index f50a79ec1..5725d2d1c 100644
--- a/cbuildbot/stages/test_stages.py
+++ b/cbuildbot/stages/test_stages.py
@@ -4,6 +4,8 @@
"""Module containing the test stages."""
+from __future__ import print_function
+
import collections
import logging
import os
diff --git a/cbuildbot/stages/test_stages_unittest.py b/cbuildbot/stages/test_stages_unittest.py
index e61f95062..2bd0aeffa 100755
--- a/cbuildbot/stages/test_stages_unittest.py
+++ b/cbuildbot/stages/test_stages_unittest.py
@@ -5,6 +5,8 @@
"""Unittests for test stages."""
+from __future__ import print_function
+
import mox
import os
import sys