diff options
author | Zhizhou Yang <zhizhouy@google.com> | 2019-12-23 16:56:26 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-01-09 07:34:17 +0000 |
commit | 45e4c1f8be303b43030e3dfac6cab5cd67d10a99 (patch) | |
tree | f00931a3bf505fded2f375f7589b41e6dfc34f18 /cros_utils/buildbot_utils.py | |
parent | e41baa8073f6f5d160ef8cf75ccb7ca9beb1ad72 (diff) | |
download | toolchain-utils-45e4c1f8be303b43030e3dfac6cab5cd67d10a99.tar.gz |
toolchain-utils: Migrate cros_utils to python3
This patch fixes all presubmit checks in cros_utils and migrated it from
python2 to python3.
TEST=Passed all unittests and presubmit checks.
BUG=chromium:1011676
Change-Id: I3a7097d6570fb2cb4e5dcdd5ae22f30c5c5762e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1981087
Commit-Queue: Zhizhou Yang <zhizhouy@google.com>
Tested-by: Zhizhou Yang <zhizhouy@google.com>
Auto-Submit: Zhizhou Yang <zhizhouy@google.com>
Reviewed-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'cros_utils/buildbot_utils.py')
-rw-r--r-- | cros_utils/buildbot_utils.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cros_utils/buildbot_utils.py b/cros_utils/buildbot_utils.py index 35dc3ac6..a06abd26 100644 --- a/cros_utils/buildbot_utils.py +++ b/cros_utils/buildbot_utils.py @@ -5,6 +5,7 @@ """Utilities for launching and accessing ChromeOS buildbots.""" +from __future__ import division from __future__ import print_function import ast @@ -133,7 +134,7 @@ def GetTrybotImage(chromeos_root, patch_list, tryjob_flags=None, build_toolchain=False, - async=False): + asynchronous=False): """Launch buildbot and get resulting trybot artifact name. This function launches a buildbot with the appropriate flags to @@ -151,7 +152,7 @@ def GetTrybotImage(chromeos_root, tryjob_flags: See cros tryjob --help for available options. build_toolchain: builds and uses the latest toolchain, rather than the prebuilt one in SDK. - async: don't wait for artifacts; just return the buildbucket id + asynchronous: don't wait for artifacts; just return the buildbucket id Returns: (buildbucket id, partial image url) e.g. @@ -159,7 +160,7 @@ def GetTrybotImage(chromeos_root, """ buildbucket_id = SubmitTryjob(chromeos_root, buildbot_name, patch_list, tryjob_flags, build_toolchain) - if async: + if asynchronous: return buildbucket_id, ' ' # The trybot generally takes more than 2 hours to finish. @@ -246,7 +247,7 @@ def GetLatestImage(chromeos_root, path): _, out, _ = ce.ChrootRunCommandWOutput( chromeos_root, command, print_to_console=False) candidates = [l.split('/')[-2] for l in out.split()] - candidates = map(fmt.match, candidates) + candidates = [fmt.match(c) for c in candidates] candidates = [[int(r) for r in m.group(1, 2, 3, 4)] for m in candidates if m] candidates.sort(reverse=True) for c in candidates: |