aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Burgess IV <gbiv@google.com>2022-07-25 12:30:08 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-07-25 20:06:12 +0000
commit5f84460959d28b1bf80e429eede18aaa6ef20ccf (patch)
tree88554f1c72062d26c727e87bfdd80b3e9af244e1
parent06c7bfa5c6e52e01dc2fdcb24b7062f1d06f9bdf (diff)
downloadtoolchain-utils-5f84460959d28b1bf80e429eede18aaa6ef20ccf.tar.gz
buildbot_utils: remove out-of-date code
It's well past 2019. Let's remove this. Style changes are courtesy of `yapf`. BUG=None TEST=None Change-Id: Ic70f01775958fc61790901028569945f76eeb763 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3785491 Tested-by: George Burgess <gbiv@chromium.org> Commit-Queue: George Burgess <gbiv@chromium.org> Auto-Submit: George Burgess <gbiv@chromium.org> Reviewed-by: Jordan Abrahams-Whitehead <ajordanr@google.com>
-rw-r--r--cros_utils/buildbot_utils.py26
1 files changed, 11 insertions, 15 deletions
diff --git a/cros_utils/buildbot_utils.py b/cros_utils/buildbot_utils.py
index 2da5c5e4..3cff9d93 100644
--- a/cros_utils/buildbot_utils.py
+++ b/cros_utils/buildbot_utils.py
@@ -17,6 +17,7 @@ import time
from cros_utils import command_executer
from cros_utils import logger
+
INITIAL_SLEEP_TIME = 7200 # 2 hours; wait time before polling buildbot.
SLEEP_TIME = 600 # 10 minutes; time between polling of buildbot.
@@ -177,8 +178,8 @@ def GetTrybotImage(chromeos_root,
else:
wait_msg = 'Unable to find build result; job may be running.'
logger.GetLogger().LogOutput(wait_msg)
- logger.GetLogger().LogOutput('{0} minutes elapsed.'.format(elapsed / 60))
- logger.GetLogger().LogOutput('Sleeping {0} seconds.'.format(SLEEP_TIME))
+ logger.GetLogger().LogOutput(f'{elapsed / 60} minutes elapsed.')
+ logger.GetLogger().LogOutput(f'Sleeping {SLEEP_TIME} seconds.')
time.sleep(SLEEP_TIME)
elapsed += SLEEP_TIME
else:
@@ -243,8 +244,9 @@ def GetLatestImage(chromeos_root, path):
ce = command_executer.GetCommandExecuter()
command = ('gsutil ls gs://chromeos-image-archive/%s' % path)
- ret, out, _ = ce.ChrootRunCommandWOutput(
- chromeos_root, command, print_to_console=False)
+ ret, out, _ = ce.ChrootRunCommandWOutput(chromeos_root,
+ command,
+ print_to_console=False)
if ret != 0:
raise RuntimeError('Failed to list buckets with command: %s.' % command)
candidates = [l.split('/')[-2] for l in out.split()]
@@ -253,11 +255,6 @@ def GetLatestImage(chromeos_root, path):
candidates.sort(reverse=True)
for c in candidates:
build = '%s/R%d-%d.%d.%d' % (path, c[0], c[1], c[2], c[3])
- # Denylist "R79-12384.0.0" image released by mistake.
- # TODO(crbug.com/992242): Remove the filter by 2019-09-05.
- if c == [79, 12384, 0, 0]:
- continue
-
if DoesImageExist(chromeos_root, build):
return build
@@ -273,16 +270,15 @@ def GetLatestRecipeImage(chromeos_root, path):
ce = command_executer.GetCommandExecuter()
command = ('gsutil ls gs://chromeos-image-archive/%s' % path)
- ret, out, _ = ce.ChrootRunCommandWOutput(
- chromeos_root, command, print_to_console=False)
+ ret, out, _ = ce.ChrootRunCommandWOutput(chromeos_root,
+ command,
+ print_to_console=False)
if ret != 0:
raise RuntimeError('Failed to list buckets with command: %s.' % command)
candidates = [l.split('/')[-2] for l in out.split()]
candidates = [(fmt.match(c), c) for c in candidates]
- candidates = [([int(r)
- for r in m[0].group(1, 2, 3, 4, 5)], m[1])
- for m in candidates
- if m]
+ candidates = [([int(r) for r in m[0].group(1, 2, 3, 4, 5)], m[1])
+ for m in candidates if m]
candidates.sort(key=lambda x: x[0], reverse=True)
# Try to get ony last two days of images since nightly tests are run once
# another day.