tools/image-info/ostree: don't record the commit sha

This is not stable between builds, instead, record the inputhash, which
is.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2020-06-11 19:20:46 +02:00 committed by Ondřej Budai
parent 2dfa0260a6
commit fcd5ff76ac
2 changed files with 8 additions and 5 deletions

View file

@ -333,11 +333,13 @@ def append_ostree_repo(report, repo):
r = ostree("refs")
refs = r.stdout.strip().split("\n")
resolved = {r: ostree("rev-parse", r).stdout.strip() for r in refs}
report["ostree"]["refs"] = refs
resolved = {r: ostree("rev-parse", r).stdout.strip() for r in refs}
commit = resolved[refs[0]]
report["ostree"]["refs"] = resolved
report["ostree"]["commit"] = commit
refs = {r: {"inputhash": ostree("show", "--print-metadata-key=rpmostree.inputhash", resolved[r]).stdout.strip("'\n")} for r in refs}
report["ostree"]["refs"] = refs
with tempfile.TemporaryDirectory() as tmpdir:
tree = os.path.join(tmpdir, "tree")