Fixed local index file generation
This commit is contained in:
parent
f3ecc11eda
commit
e4155140f1
1 changed files with 3 additions and 1 deletions
|
@ -102,7 +102,9 @@ class S3Source(FileBasedSource):
|
||||||
if obj.object_name is not None and self.has_correct_extension(obj.object_name)
|
if obj.object_name is not None and self.has_correct_extension(obj.object_name)
|
||||||
]
|
]
|
||||||
if self.index_file is not None and not os.path.isfile(self.index_file):
|
if self.index_file is not None and not os.path.isfile(self.index_file):
|
||||||
os.makedirs(os.path.dirname(self.index_file), exist_ok=True)
|
index_dir = os.path.dirname(self.index_file)
|
||||||
|
if index_dir:
|
||||||
|
os.makedirs(os.path.dirname(self.index_file), exist_ok=True)
|
||||||
|
|
||||||
with open(self.index_file, "w", encoding="utf8") as index_file_handle:
|
with open(self.index_file, "w", encoding="utf8") as index_file_handle:
|
||||||
dump(file_list, index_file_handle)
|
dump(file_list, index_file_handle)
|
||||||
|
|
Loading…
Add table
Reference in a new issue