From 1c5b0d123747b945a88f8e39f05dd9ed56aa1f55 Mon Sep 17 00:00:00 2001 From: Yuval Turgeman Date: Tue, 19 Feb 2019 18:09:36 +0200 Subject: [PATCH] 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 (cherry picked from commit 1c731b561887a1f62697495ecb70942d335828fd) --- src/pylorax/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pylorax/installer.py b/src/pylorax/installer.py index cba2c8cd..36fba3cd 100644 --- a/src/pylorax/installer.py +++ b/src/pylorax/installer.py @@ -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: