From 3d376764d4273143ce2b0295caa9d6ea7eff5a29 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 Resolves: rhbz#1684316 --- 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 6317c571..85a335df 100644 --- a/src/pylorax/installer.py +++ b/src/pylorax/installer.py @@ -566,7 +566,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: