23
23
final_path = os.path.join(output_dir, out_name + '.tar.gz')
24
24
if os.path.exists(final_path):
28
28
fn, tmp_path=tempfile.mkstemp(suffix='.tar', prefix=out_name, dir=output_dir)
33
33
tar = tarfile.TarFile(name=tmp_path, mode='w')
34
34
tar.add(local_dir, arcname=out_name, recursive=True)
39
39
if os.system('gzip "%s"' % tmp_path) != 0:
40
40
raise ValueError('Failed to compress')