ostree: Send correct ref in the message

If configuration requests a different ref than what treefile has, a
wrong message can be sent.

If the treefile is in JSON, the local copy will be updated in-place and
it works. However with YAML the updated version is still written as JSON
and thus we are still sending the original value.

Fixes: https://pagure.io/pungi/issue/1092
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2018-12-05 11:20:17 +01:00
parent 7c48b808f1
commit 5f6dcb37f6

View File

@ -93,8 +93,12 @@ class OSTreeThread(WorkerThread):
extra_config_file=extra_config_file) extra_config_file=extra_config_file)
if compose.notifier: if compose.notifier:
ref = get_ref_from_treefile(os.path.join(repodir, config['treefile']), original_ref = get_ref_from_treefile(
arch, logger=self.pool._logger) os.path.join(repodir, config["treefile"]),
arch,
logger=self.pool._logger,
)
ref = config.get("ostree_ref") or original_ref
# 'pungi-make-ostree tree' writes commitid to commitid.log in # 'pungi-make-ostree tree' writes commitid to commitid.log in
# logdir, except if there was no new commit we will get None # logdir, except if there was no new commit we will get None
# instead. If the commit id could not be read, an exception will be # instead. If the commit id could not be read, an exception will be