From 548cb4a01f6ceb8a78f7aea579291aa02b6ff37c Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Jan 13 2021 14:13:58 +0000 Subject: PR#2635: update image volume in db ASAP Merges #2635 https://pagure.io/koji/pull-request/2635 Fixes: #2634 https://pagure.io/koji/issue/2634 wrapperRPM doesn't work with image policy fix --- diff --git a/hub/kojihub.py b/hub/kojihub.py index e0dae1f..8841bd7 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -13830,7 +13830,6 @@ class HostExports(object): build_info = get_build(build_id, strict=True) # check volume policy - vol_update = False policy_data = { 'build': build_info, 'package': build_info['name'], @@ -13842,7 +13841,10 @@ class HostExports(object): if vol['id'] != build_info['volume_id']: build_info['volume_id'] = vol['id'] build_info['volume_name'] = vol['name'] - vol_update = True + update = UpdateProcessor('build', clauses=['id=%(build_id)i'], + values={'build_id': build_id}) + update.set(volume_id=build_info['volume_id']) + update.execute() self.importImage(task_id, build_info, results) ensure_volume_symlink(build_info) @@ -13856,8 +13858,6 @@ class HostExports(object): values={'build_id': build_id}) update.set(id=build_id, state=st_complete) update.rawset(completion_time='now()') - if vol_update: - update.set(volume_id=build_info['volume_id']) update.execute() build_info = get_build(build_id, strict=True) koji.plugin.run_callbacks('postBuildStateChange',