'Update the map of partition => [replicas] to be reassigned from
removed devices.'

def _gather_parts_from_failed_devices(self, assign_parts):

    if self._remove_devs:
        dev_ids = [d['id'] for d in self._remove_devs if d['parts']]
        if dev_ids:
            for (part, replica) in self._each_part_replica():
                dev_id = self._replica2part2dev[replica][part]
                if (dev_id in dev_ids):
                    self._replica2part2dev[replica][part] = NONE_DEV
                    self._set_part_moved(part)
                    assign_parts[part].append(replica)
                    self.logger.debug('Gathered    %d/%d    from    dev    %d    [dev    removed]', part, replica, dev_id)
    removed_devs = 0
    while self._remove_devs:
        remove_dev_id = self._remove_devs.pop()['id']
        self.logger.debug('Removing    dev    %d', remove_dev_id)
        self.devs[remove_dev_id] = None
        removed_devs += 1
    return removed_devs
