PR#3445: Don't crash in _checkImageState if there's no image.os_plugin

Merges #3445
https://pagure.io/koji/pull-request/3445

Fixes #3447
https://pagure.io/koji/issue/3447
This commit is contained in:
Tomas Kopecek 2022-07-29 13:45:25 +02:00
commit e8a94eaef9

View file

@ -4164,7 +4164,8 @@ class BaseImageTask(OzImageTask):
if scrnshot:
ext = scrnshot[-3:]
self.uploadFile(scrnshot, remoteName='screenshot.%s' % ext)
image.os_plugin.abort() # forcibly tear down the VM
if image.os_plugin:
image.os_plugin.abort() # forcibly tear down the VM
# TODO abort when a task is CANCELLED
if not self.session.checkUpload('', os.path.basename(self.ozlog)):
self.tlog.removeHandler(self.fhandler)