diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2020-04-28 20:24:56 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-04-28 20:24:56 +0000 |
commit | 656c7c0fa0d9b776c019f5423e01a9a28979d2bd (patch) | |
tree | 220a95d346d58fa5090d8033991bcfef2ad03d99 /auto_delete_nightly_test_data.py | |
parent | 091406baac88deeb2ef9c71d5047bd9daf3915ef (diff) | |
parent | ccead650bb8e050400f55dc44b60f989b1f8e117 (diff) | |
download | toolchain-utils-656c7c0fa0d9b776c019f5423e01a9a28979d2bd.tar.gz |
Snap for 6439596 from ccead650bb8e050400f55dc44b60f989b1f8e117 to qt-aml-tzdata-releaseq_tzdata_aml_297100400q_tzdata_aml_297100300q_tzdata_aml_297100000q_tzdata_aml_296200000q_tzdata_aml_295600118q_tzdata_aml_295600110q_tzdata_aml_295500002q_tzdata_aml_295500001q_tzdata_aml_294400310android-mainline-12.0.0_r54android-mainline-12.0.0_r111android-mainline-10.0.0_r13android-mainline-10.0.0_r12android-mainline-10.0.0_r11q_tzdata_aml_297100000android12-mainline-tzdata-releaseandroid10-mainline-tzdata-releaseandroid10-android13-mainline-tzdata-release
Change-Id: I3464301d9b41d48e11dfd361a411d60a1bd5a429
Diffstat (limited to 'auto_delete_nightly_test_data.py')
-rwxr-xr-x | auto_delete_nightly_test_data.py | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/auto_delete_nightly_test_data.py b/auto_delete_nightly_test_data.py index 699e12a0..4f91b042 100755 --- a/auto_delete_nightly_test_data.py +++ b/auto_delete_nightly_test_data.py @@ -1,10 +1,4 @@ #!/usr/bin/env python2 -# -*- coding: utf-8 -*- -# -# Copyright 2019 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - """A crontab script to delete night test data.""" from __future__ import print_function @@ -27,8 +21,7 @@ DIR_BY_WEEKDAY = ('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun') def CleanNumberedDir(s, dry_run=False): """Deleted directories under each dated_dir.""" chromeos_dirs = [ - os.path.join(s, x) - for x in os.listdir(s) + os.path.join(s, x) for x in os.listdir(s) if misc.IsChromeOsTree(os.path.join(s, x)) ] ce = command_executer.GetCommandExecuter(log_level='none') @@ -69,8 +62,7 @@ def CleanNumberedDir(s, dry_run=False): def CleanDatedDir(dated_dir, dry_run=False): # List subdirs under dir subdirs = [ - os.path.join(dated_dir, x) - for x in os.listdir(dated_dir) + os.path.join(dated_dir, x) for x in os.listdir(dated_dir) if os.path.isdir(os.path.join(dated_dir, x)) ] all_succeeded = True @@ -112,7 +104,6 @@ def CleanChromeOsTmpFiles(chroot_tmp, days_to_preserve, dry_run): cmd = (r'find {0} -maxdepth 1 -type d ' r'\( -name "test_that_*" -amin +{1} -o ' r' -name "cros-update*" -amin +{1} -o ' - r' -name "CrAU_temp_data*" -amin +{1} -o ' r' -regex "{0}/tmp......" -amin +{1} \) ' r'-exec bash -c "echo rm -fr {{}}" \; ' r'-exec bash -c "rm -fr {{}}" \;').format(chroot_tmp, minutes) @@ -199,7 +190,6 @@ def Main(argv): os.path.join(constants.CROSTC_WORKSPACE, dated_dir), options.dry_run) else 1 - ## Finally clean temporaries, images under crostc/chromeos rv2 = CleanChromeOsTmpAndImages( int(options.days_to_preserve), options.dry_run) |