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

@ -8882,9 +8882,10 @@
"VERSION_ID": "8.2"
},
"ostree": {
"commit": "3ce9eb458244c79f125153a362451f8b8cb9d2594c8c58c19e02cb32fc9fe2d3",
"refs": {
"rhel/8/x86_64/edge": "3ce9eb458244c79f125153a362451f8b8cb9d2594c8c58c19e02cb32fc9fe2d3"
"rhel/8/x86_64/edge": {
"inputhash": "b458ad7246fbf8126d2ff81bf3ec24d70b1c573d26e178da5545bc3d27c7c193"
}
},
"repo": {
"core.mode": "archive-z2"

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")