installer: make sure cancel_func has a value (#612)

When using LMC to virt-install a system to an image, cancel_func is not
provided in run_creator, causing a TypeError (NoneType object is not
callable).

Signed-off-by: Yuval Turgeman <yturgema@redhat.com>
(cherry picked from commit 1c731b5618)
This commit is contained in:
Yuval Turgeman 2019-02-19 18:09:36 +02:00 committed by Brian C. Lane
parent 03a2c09301
commit 1c5b0d1237
1 changed files with 1 additions and 1 deletions

View File

@ -572,7 +572,7 @@ def virt_install(opts, install_log, disk_img, disk_size, cancel_func=None):
else:
msg = "virt_install failed on line: %s" % log_monitor.server.error_line
raise InstallError(msg)
elif cancel_func():
elif cancel_func and cancel_func():
raise InstallError("virt_install canceled by cancel_func")
if opts.make_fsimage: