def _update_pull_progress(self, last):
        last = json.loads(last.decode('utf-8'))
        if 'error' in last:
            raise exceptions.ContainerOrchestrationException(
                self.container,
                'Pull of image {} failed: {}'.format(
                    self.container.image,
                    last['errorDetail']['message']))

        try:
            self._progress[last['id']] = (
                100 if last['status'] == 'Download complete' else
                (100.0 * last['progressDetail']['current'] /
                 last['progressDetail']['total']))
        except:
            pass

        total = 0
        if len(self._progress):
            for downloaded in self._progress.values():
                total += downloaded
            total /= len(self._progress)
        return total
Update an image pull progress map with latest download progress
dataset/ETHPy150Open signalfx/maestro-ng/maestro/plays/tasks.py/PullTask._update_pull_progress