From 2c401a4a5ccfb62fe32e9d179193601ad768ae40 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Thu, 15 Sep 2016 11:09:06 +0000 Subject: [PATCH] Send fedmsg message on ostree compose finishg This sends a message when we finish composing an ostree. Signed-off-by: Patrick Uiterwijk --- pungi/phases/ostree.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pungi/phases/ostree.py b/pungi/phases/ostree.py index 9e90f325..c25ab84d 100644 --- a/pungi/phases/ostree.py +++ b/pungi/phases/ostree.py @@ -56,8 +56,25 @@ class OSTreeThread(WorkerThread): self._run_ostree_cmd(compose, variant, arch, config, repodir) + if compose.notifier: + ref, commitid = self._get_commit_info() + compose.notifier.send('ostree', + variant=variant.uid, + arch=arch, + ref=ref, + commitid=commitid) + self.pool.log_info('[DONE ] %s' % msg) + def _get_commit_info(self): + with open(os.path.join(self.logdir, 'create-ostree-repo.log'), 'r') as f: + for line in f.readlines(): + if ' => ' in line: + line = line.replace('\n', '') + ref, _, commitid = line.partition(' => ') + return ref, commitid + return None, None + def _run_ostree_cmd(self, compose, variant, arch, config, config_repo): cmd = [ 'pungi-make-ostree',