possible mongo fix (#3319)

* possible mongo fix

* prevent swallowing the exception

* better log str
This commit is contained in:
Michael H
2020-01-09 23:56:05 -05:00
committed by GitHub
parent ed692bcaa5
commit acc5baec7d
3 changed files with 35 additions and 7 deletions

View File

@@ -73,7 +73,12 @@ def get_driver_class(storage_type: Optional[BackendType] = None) -> Type[BaseDri
def get_driver(
cog_name: str, identifier: str, storage_type: Optional[BackendType] = None, **kwargs
cog_name: str,
identifier: str,
storage_type: Optional[BackendType] = None,
*,
allow_old: bool = False,
**kwargs,
):
"""Get a driver instance.
@@ -107,7 +112,10 @@ def get_driver(
storage_type = BackendType.JSON
try:
driver_cls: Type[BaseDriver] = get_driver_class(storage_type)
if not allow_old:
driver_cls: Type[BaseDriver] = get_driver_class(storage_type)
else:
driver_cls: Type[BaseDriver] = _get_driver_class_include_old(storage_type)
except ValueError:
if storage_type in (BackendType.MONGOV1, BackendType.MONGO):
raise RuntimeError(