Skip to content

Commit

Permalink
Status CLI: handle permission error
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsvu committed Jan 13, 2025
1 parent edd7fe3 commit 5d31398
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tools/Status/Status.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ def get_input_file(comment: Optional[str], work_dir: str) -> Optional[str]:
# Fallback: Check if there's a single YAML file in the work dir
yaml_files = glob.glob(os.path.join(work_dir, "*.yaml"))
if len(yaml_files) == 1:
try:
open(yaml_files[0], "r").close()
except PermissionError:
logger.debug(
f"Unable to open potential input file: {yaml_files[0]}.",
exc_info=True,
)
return None
return yaml_files[0]
else:
logger.debug(
Expand Down

0 comments on commit 5d31398

Please sign in to comment.