Chromium Code Reviews| Index: tools/archive_crash.py |
| diff --git a/tools/archive_crash.py b/tools/archive_crash.py |
| index ce2fe02cec1d140bfd63c8f4643f1207206a50a0..b17d50c9930409bdd86eda351ecc71acdac1bea8 100755 |
| --- a/tools/archive_crash.py |
| +++ b/tools/archive_crash.py |
| @@ -19,19 +19,19 @@ import uuid |
| GCS_FOLDER = 'dart-crashes' |
| -def CreateTarball(dir, tarname): |
| - print 'Creating tar file: %s' % (tarname) |
| +def CreateTarball(the_dir, tarname): |
|
ricow1
2014/06/23 06:58:21
why this change?
kaendfinger
2014/06/24 05:54:33
All of the the_ kind of stuff is due to the overri
ricow1
2014/06/24 07:41:54
The reason is valid, but the_ is not that nice. It
|
| + print 'Creating tar file: %s' % tarname |
| tar = tarfile.open(tarname, mode='w:gz') |
| - tar.add(dir) |
| + tar.add(the_dir) |
| tar.close() |
| def CopyToGCS(filename): |
| gs_location = 'gs://%s/%s/' % (GCS_FOLDER, uuid.uuid4()) |
| cmd = ['gsutil', 'cp', filename, gs_location] |
| - print 'Running command: %s' % (cmd) |
| + print 'Running command: %s' % cmd |
| subprocess.check_call(cmd) |
| archived_filename = '%s%s' % (gs_location, filename.split('/').pop()) |
| - print 'Dump now available in %s' % (archived_filename) |
| + print 'Dump now available in %s' % archived_filename |
| def Main(): |
| if utils.GuessOS() != 'linux': |
| @@ -41,7 +41,7 @@ def Main(): |
| num_dumps = 0 |
| for v in os.listdir('/tmp'): |
| if v.startswith('coredump'): |
| - fullpath = '/tmp/%s' % (v) |
| + fullpath = '/tmp/%s' % v |
| if os.path.isdir(fullpath): |
| num_dumps += 1 |
| tarname = '%s.tar.gz' % fullpath |
| @@ -49,7 +49,7 @@ def Main(): |
| CopyToGCS(tarname) |
| os.unlink(tarname) |
| shutil.rmtree(fullpath) |
| - print 'Found %s core dumps' % (num_dumps) |
| + print 'Found %s core dumps' % num_dumps |
| if __name__ == '__main__': |
| sys.exit(Main()) |