diff options
author | Radostin Stoyanov <rstoyanov1@gmail.com> | 2017-07-18 10:12:55 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cbosdonnat@suse.com> | 2017-07-18 17:43:14 +0200 |
commit | 0b0f8ce3b0af0a148517c4e3d9ab2d0e3a19def1 (patch) | |
tree | 150718df61822da9cb3866241a5a110d829a141c /src | |
parent | 17d8ec8900cd981f8e1db5a7e7b323cc5c9e8f43 (diff) | |
download | virt-bootstrap.git-0b0f8ce3b0af0a148517c4e3d9ab2d0e3a19def1.tar.gz virt-bootstrap.git-0b0f8ce3b0af0a148517c4e3d9ab2d0e3a19def1.tar.xz virt-bootstrap.git-0b0f8ce3b0af0a148517c4e3d9ab2d0e3a19def1.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/virtBootstrap/sources.py | 3 |
1 files changed, 3 insertions, 0 deletions
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] |