Skip to content

Commit

Permalink
Mod: Add permission info for SPICE crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
Labbeti committed Sep 18, 2023
1 parent eafb38a commit 49b9e93
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/aac_metrics/functional/spice.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,29 @@ def spice(
pylog.error("Invalid SPICE call.")
pylog.error(f"Full command: '{' '.join(spice_cmd)}'")
pylog.error(f"Error: {err}")

for fpath in (
java_path,
spice_fpath,
in_file.name,
spice_cache,
out_file.name,
):
info = {"t": "-", "r": "-", "w": "-", "x": "-"}
if osp.isfile(fpath):
info["t"] = "f"
elif osp.isdir(fpath):
info["t"] = "d"

if os.access(fpath, os.R_OK):
info["r"] = "r"
if os.access(fpath, os.W_OK):
info["w"] = "w"
if os.access(fpath, os.X_OK):
info["x"] = "x"

pylog.error(f"{fpath} :\t {''.join(info.values())}")

if (
stdout is not None
and stderr is not None
Expand Down

0 comments on commit 49b9e93

Please sign in to comment.