Skip to content

Commit

Permalink
try and fix postprocess() methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sfowl committed Nov 6, 2024
1 parent 76e89fd commit 56d836f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scanners/generic/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def postprocess(self):
logging.info(f"Extracting report, storing in {self.results_dir}")
result = self.my_conf("results")
try:
os.makedirs(self.results_dir)
os.makedirs(self.results_dir, exist_ok=True)
if os.path.isdir(result):
shutil.copytree(result, self.results_dir, dirs_exist_ok=True)
else:
Expand Down
2 changes: 1 addition & 1 deletion scanners/zap/zap.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def postprocess(self):
logging.debug(f"reports_dir: {reports_dir}")

logging.info(f"Extracting report, storing in {self.results_dir}")
shutil.copytree(reports_dir, self.results_dir)
shutil.copytree(reports_dir, self.results_dir, dirs_exist_ok=True)

logging.info("Saving the session as evidence")
with tarfile.open(f"{self.results_dir}/session.tar.gz", "w:gz") as tar:
Expand Down

0 comments on commit 56d836f

Please sign in to comment.