Skip to content

Commit

Permalink
DockerWrapper.run_container, progress tracking: handle KeyError for p…
Browse files Browse the repository at this point in the history
…rogressDetail
  • Loading branch information
szilard-nemeth committed Jan 9, 2025
1 parent 91c3f74 commit 06a0354
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pythoncommons/docker_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,12 @@ def capture_progress(self, image, line):
elif operation == DockerOperation.EXTRACT:
description = self.extracting_description(image)

total = line['progressDetail']['total']
current = line['progressDetail']['current']
try:
total = line["progressDetail"]["total"]
current = line["progressDetail"]["current"]
except KeyError:
LOG.warning("Unexpected line, cannot read progress details. Line was: %s", line)
return
self.store_layer_data(key, operation, layer, current, total)

# If this is a new layer for key (image + operation), we need to increase the total for that image
Expand Down

0 comments on commit 06a0354

Please sign in to comment.