remote: azure: implement batch_exists

This commit is contained in:
pared
2019-08-12 10:59:24 +02:00
committed by pawel
parent a063f408a2
commit 71abef74f5
+11
View File
@@ -1,6 +1,7 @@
from __future__ import absolute_import
from __future__ import unicode_literals
import itertools
import os
import re
import logging
@@ -154,3 +155,13 @@ class RemoteAZURE(RemoteBASE):
path_info.bucket, path_info.path, sas_token=sas_token
)
return download_url
def batch_exists(self, path_infos, callback):
paths = []
for path_info in path_infos:
paths.append(self._list_paths(path_info.bucket, path_info.path))
callback.update(str(path_info))
paths = set(itertools.chain.from_iterable(paths))
return [path_info.path in paths for path_info in path_infos]