aboutsummaryrefslogtreecommitdiff
path: root/auto_delete_nightly_test_data.py
diff options
context:
space:
mode:
authorYunlian Jiang <yunlian@google.com>2015-12-16 11:06:13 -0800
committerchrome-bot <chrome-bot@chromium.org>2015-12-16 20:58:59 +0000
commitd97422aef5709f0a3b16b4efebc397c891940c95 (patch)
treea3f98942d18ae9dfc1e0f1614851579f693905ed /auto_delete_nightly_test_data.py
parentf2a3ef46f75d2196a93d3ed27f4d1fcf22b54fbe (diff)
downloadtoolchain-utils-d97422aef5709f0a3b16b4efebc397c891940c95.tar.gz
crosperf: clean lint warnings.
BUG=chromium:567921 TEST=these three files are lint warning free. Change-Id: I23f9120283fc82958abcc16f47cd29d5800bd181 Reviewed-on: https://chrome-internal-review.googlesource.com/242485 Commit-Ready: Yunlian Jiang <yunlian@google.com> Tested-by: Yunlian Jiang <yunlian@google.com> Reviewed-by: Caroline Tice <cmtice@google.com>
Diffstat (limited to 'auto_delete_nightly_test_data.py')
-rwxr-xr-xauto_delete_nightly_test_data.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/auto_delete_nightly_test_data.py b/auto_delete_nightly_test_data.py
index ea6ea7cc..e01cb08b 100755
--- a/auto_delete_nightly_test_data.py
+++ b/auto_delete_nightly_test_data.py
@@ -1,5 +1,8 @@
-#!/usr/bin/python
+#!/usr/bin/python2
"""A crontab script to delete night test data."""
+
+from __future__ import print_function
+
__author__ = 'shenhan@google.com (Han Shen)'
import datetime
@@ -24,13 +27,13 @@ def CleanNumberedDir(s, dry_run=False):
all_succeeded = True
for cd in chromeos_dirs:
if misc.DeleteChromeOsTree(cd, dry_run=dry_run):
- print 'Successfully removed chromeos tree "{0}".'.format(cd)
+ print('Successfully removed chromeos tree "{0}".'.format(cd))
else:
all_succeeded = False
- print 'Failed to remove chromeos tree "{0}", please check.'.format(cd)
+ print('Failed to remove chromeos tree "{0}", please check.'.format(cd))
if not all_succeeded:
- print 'Failed to delete at least one chromeos tree, please check.'
+ print('Failed to delete at least one chromeos tree, please check.')
return False
## Now delete the numbered dir Before forcibly removing the directory, just
@@ -45,13 +48,13 @@ def CleanNumberedDir(s, dry_run=False):
cmd = 'rm -fr {0}'.format(s)
if dry_run:
- print cmd
+ print(cmd)
else:
if ce.RunCommand(cmd, print_to_console=False, terminated_timeout=480) == 0:
- print 'Successfully removed "{0}".'.format(s)
+ print('Successfully removed "{0}".'.format(s))
else:
all_succeeded = False
- print 'Failed to remove "{0}", please check.'.format(s)
+ print('Failed to remove "{0}", please check.'.format(s))
return all_succeeded
@@ -120,9 +123,9 @@ def CleanChromeOsTmpAndImages():
r'-exec bash -c "rm -f {{}}" \;').format(chromeos_chroot_tmp)
rv2 = ce.RunCommand(cmd, print_to_console=False)
if rv2 == 0:
- print 'Successfully cleaned chromeos images.'
+ print('Successfully cleaned chromeos images.')
else:
- print 'Some chromeos images were not removed.'
+ print('Some chromeos images were not removed.')
return rv + rv2