| Index: tools/archive_crash.py
|
| diff --git a/tools/archive_crash.py b/tools/archive_crash.py
|
| index ce2fe02cec1d140bfd63c8f4643f1207206a50a0..e7e290bf683bd69752a8d2e563ac7ef0a590dd8b 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(input_dir, tarname):
|
| + print 'Creating tar file: %s' % tarname
|
| tar = tarfile.open(tarname, mode='w:gz')
|
| - tar.add(dir)
|
| + tar.add(input_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())
|
|
|