[Fix] Path mapping only once in storage backends (#490)

This commit is contained in:
Zaida Zhou 2022-08-30 15:15:03 +08:00 committed by GitHub
parent 15905bdcc0
commit eddc92fbeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -87,7 +87,7 @@ class PetrelBackend(BaseStorageBackend):
filepath = str(filepath)
if self.path_mapping is not None:
for k, v in self.path_mapping.items():
filepath = filepath.replace(k, v)
filepath = filepath.replace(k, v, 1)
return filepath
def _format_path(self, filepath: str) -> str: