aboutsummaryrefslogtreecommitdiff
path: root/auto_delete_nightly_test_data.py
diff options
context:
space:
mode:
authorBob Haarman <inglorion@chromium.org>2020-09-19 00:00:06 +0000
committerBob Haarman <inglorion@chromium.org>2020-09-25 21:42:42 +0000
commit8223d16e040748ad6a91a87f3ce1cfc13db37f4b (patch)
treeb58dc769d183b3af7c76e6a6cec2800343d4e4f9 /auto_delete_nightly_test_data.py
parent4f7eb71f9fa78f8710e1deb57d441f51fa74af3b (diff)
downloadtoolchain-utils-8223d16e040748ad6a91a87f3ce1cfc13db37f4b.tar.gz
fix formatting/lint issues pointed out by repohooks
Previous changes resulted in some complaints about formatting and Python 3 compatibility from the repo hooks. This change fixes those. BUG=None TEST=repo upload --cbr . # check that it no longer complains Change-Id: I99cc51dcb8d499d59b7b47817f4cef8fa6ba5059 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2419831 Tested-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: Manoj Gupta (OoO) <manojgupta@chromium.org>
Diffstat (limited to 'auto_delete_nightly_test_data.py')
-rwxr-xr-xauto_delete_nightly_test_data.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/auto_delete_nightly_test_data.py b/auto_delete_nightly_test_data.py
index 884afce2..c3c2e24c 100755
--- a/auto_delete_nightly_test_data.py
+++ b/auto_delete_nightly_test_data.py
@@ -52,8 +52,8 @@ def CleanNumberedDir(s, dry_run=False):
## Now delete the numbered dir Before forcibly removing the directory, just
## check 's' to make sure it matches the expected pattern. A valid dir to be
## removed must be '/usr/local/google/crostc/(SUN|MON|TUE...|SAT)'.
- valid_dir_pattern = (
- '^' + NIGHTLY_TESTS_WORKSPACE + '/(' + '|'.join(DIR_BY_WEEKDAY) + ')')
+ valid_dir_pattern = ('^' + NIGHTLY_TESTS_WORKSPACE + '/(' +
+ '|'.join(DIR_BY_WEEKDAY) + ')')
if not re.search(valid_dir_pattern, s):
print('Trying to delete an invalid dir "{0}" (must match "{1}"), '
'please check.'.format(s, valid_dir_pattern))
@@ -193,8 +193,8 @@ def CleanOldCLs(days_to_preserve='1', dry_run=False):
ce = command_executer.GetCommandExecuter()
chromeos_root = os.path.join(constants.CROSTC_WORKSPACE, 'chromeos')
# Find Old CLs.
- old_cls_cmd = (
- 'gerrit --raw search "owner:me status:open age:%sd"' % days_to_preserve)
+ old_cls_cmd = ('gerrit --raw search "owner:me status:open age:%sd"' %
+ days_to_preserve)
_, cls, _ = ce.ChrootRunCommandWOutput(
chromeos_root, old_cls_cmd, print_to_console=False)
# Convert any whitespaces to spaces.
@@ -210,20 +210,20 @@ def CleanOldCLs(days_to_preserve='1', dry_run=False):
return ce.ChrootRunCommand(
chromeos_root, abandon_cls_cmd, print_to_console=False)
+
def CleanChromeTelemetryTmpFiles(dry_run):
rv = 0
ce = command_executer.GetCommandExecuter()
tmp_dir = os.path.join(constants.CROSTC_WORKSPACE, 'chromeos', '.cache',
'distfiles', 'target', 'chrome-src-internal', 'src',
- 'tmp');
+ 'tmp')
cmd = f'rm -fr {shlex.quote(tmp_dir)}/tmp*telemetry_Crosperf'
if dry_run:
print(f'Going to execute:\n{cmd}')
else:
rv = ce.RunCommand(cmd, print_to_console=False)
if rv == 0:
- print(f'Successfully cleaned chrome tree tmp directory '
- f'{tmp_dir!r} .')
+ print(f'Successfully cleaned chrome tree tmp directory ' f'{tmp_dir!r} .')
else:
print(f'Some directories were not removed under chrome tree '
f'tmp directory {tmp_dir!r}.')