Skip to content

Commit

Permalink
Merge pull request #19 from yongchand/main
Browse files Browse the repository at this point in the history
Add ignore errors to rmtree
  • Loading branch information
yongchand authored Dec 12, 2022
2 parents e5e4c02 + 5d1d8f0 commit f8ede39
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions klaytnetl/cli/export_block_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def export_block_group(
},
file_maxlines is None,
)
shutil.rmtree(tmpdir)
shutil.rmtree(tmpdir, ignore_errors=True)

if gcs_bucket:
sync_to_gcs(
Expand All @@ -279,4 +279,4 @@ def export_block_group(
},
file_maxlines is None,
)
shutil.rmtree(tmpdir)
shutil.rmtree(tmpdir, ignore_errors=True)
4 changes: 2 additions & 2 deletions klaytnetl/cli/export_trace_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def export_trace_group(
{traces_output, contracts_output, tokens_output},
file_maxlines is None,
)
shutil.rmtree(tmpdir)
shutil.rmtree(tmpdir, ignore_errors=True)

if gcs_bucket:
sync_to_gcs(
Expand All @@ -260,4 +260,4 @@ def export_trace_group(
{traces_output, contracts_output, tokens_output},
file_maxlines is None,
)
shutil.rmtree(tmpdir)
shutil.rmtree(tmpdir, ignore_errors=True)
2 changes: 1 addition & 1 deletion klaytnetl/cli/export_traces.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,4 @@ def export_traces(

if s3_bucket is not None:
sync_to_s3(s3_bucket, tmpdir, {output}, file_maxlines is None)
shutil.rmtree(tmpdir)
shutil.rmtree(tmpdir, ignore_errors=True)
2 changes: 1 addition & 1 deletion klaytnetl/cli/gcs_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def sync_to_gcs(bucket, tmpdir, outputs, is_single_file):
logging.info(f"Transfer {file} --> gcs://{bucket}/{out}")
blob = bucket_name.blob(f'{bucket}/{out}')
blob.upload_from_filename(f'{file}')
shutil.rmtree(temp_path)
shutil.rmtree(temp_path, ignore_errors=True)


def _get_files(path, is_single_file):
Expand Down

0 comments on commit f8ede39

Please sign in to comment.