From c41107ea51d6c532a261ad83b977baa1b6478947 Mon Sep 17 00:00:00 2001 From: Mike Bonnet Date: Oct 20 2016 20:46:32 +0000 Subject: pass build information consistently to the postImport callback Always pass the build infomation as the "build" argument to the postImport callback. For type='build' and type='image' imports, this change is additive, and so is unlikely to affect existing plugins. For type='cg' imports, this change makes the callback consistent with the other callback types, and the CG import mechanism is new enough that there is probably no code making use of it yet. --- diff --git a/hub/kojihub.py b/hub/kojihub.py index 0b11a4a..6f3988d 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -4898,7 +4898,7 @@ class CG_Importer(object): self.import_metadata() koji.plugin.run_callbacks('postImport', type='cg', metadata=metadata, - directory=directory, buildinfo=self.buildinfo) + directory=directory, build=self.buildinfo) return self.buildinfo @@ -5450,7 +5450,7 @@ def import_build_in_place(build): WHERE id=%(build_id)i""" _dml(update, locals()) koji.plugin.run_callbacks('postBuildStateChange', attribute='state', old=buildinfo['state'], new=st_complete, info=buildinfo) - koji.plugin.run_callbacks('postImport', type='build', in_place=True, srpm=srpm, rpms=rpms) + koji.plugin.run_callbacks('postImport', type='build', in_place=True, build=buildinfo, srpm=srpm, rpms=rpms) return build_id def _import_wrapper(task_id, build_info, rpm_results): @@ -8183,7 +8183,7 @@ def importImageInternal(task_id, build_id, imgdata): _dml(q, {'archive_id': archive['id'], 'rpm_id': rpm_id}) koji.plugin.run_callbacks('postImport', type='image', image=imgdata, - fullpath=fullpath) + build=build_info, fullpath=fullpath) # # XMLRPC Methods