From 0b0f8ce3b0af0a148517c4e3d9ab2d0e3a19def1 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Tue, 18 Jul 2017 10:12:55 +0100 Subject: DockerSource: Don't calc progress on short lines Perform additional check of the input to avoid unexpected behaviour when string is passed instead of list or a list with short length. --- src/virtBootstrap/sources.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/virtBootstrap/sources.py b/src/virtBootstrap/sources.py index f05d057..4f1b104 100644 --- a/src/virtBootstrap/sources.py +++ b/src/virtBootstrap/sources.py @@ -214,6 +214,9 @@ class DockerSource(object): Calculate percentage and update the progress of virt-bootstrap. """ + if not (len(line_split) > 4 and isinstance(line_split, list)): + return + d_size, d_format = utils.str2float(line_split[0]), line_split[1] t_size, t_format = utils.str2float(line_split[3]), line_split[4] -- cgit