Skip to content
Snippets Groups Projects
Commit e06e9423 authored by Ashwin Kumar Karnad's avatar Ashwin Kumar Karnad
Browse files

fix script hash not found when calling script as installed package

parent 94bb4ac8
No related branches found
No related tags found
1 merge request!70Convert to a package
Pipeline #371912 failed
......@@ -599,24 +599,28 @@ def record_script_execution_summary(
cmd_line = " ".join(sys.argv)
# script branch and commit hash
with os_chdir(root_dir):
script_branch = (
run(
["git", "rev-parse", "--abbrev-ref", "HEAD"],
stdout=subprocess.PIPE,
check=True,
try:
script_branch = (
run(
["git", "rev-parse", "--abbrev-ref", "HEAD"],
stdout=subprocess.PIPE,
check=True,
)
.stdout.decode()
.strip()
)
.stdout.decode()
.strip()
)
script_commit_hash = (
run(
["git", "rev-parse", "--short", "HEAD"],
stdout=subprocess.PIPE,
check=True,
script_commit_hash = (
run(
["git", "rev-parse", "--short", "HEAD"],
stdout=subprocess.PIPE,
check=True,
)
.stdout.decode()
.strip()
)
.stdout.decode()
.strip()
)
except subprocess.CalledProcessError:
script_branch = "unknown"
script_commit_hash = "unknown"
# spack-environments branch and commit hash from kwargs
spe_branch = kwargs.get("spe_branch", None)
spe_commit_hash = kwargs.get("spe_commit_hash", None)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment