From 03d7a107bfdd67725854b40a2d67f2b3fbcecbf2 Mon Sep 17 00:00:00 2001 From: bmccandless Date: Sun, 29 Mar 2020 09:20:34 -0700 Subject: [PATCH] Fix for s3 region name in data locator (#1316) There is a small chicken and egg problem. The config file could be in s3, therefore when using the DataLocator to download the config file, we don't yet have an app_config object. Adding a check to handle this case. --- server/common/data_locator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/common/data_locator.py b/server/common/data_locator.py index ea6b347a..71325f66 100644 --- a/server/common/data_locator.py +++ b/server/common/data_locator.py @@ -39,7 +39,7 @@ class DataLocator: self.cname = self.path if self.protocol == "file" else self.uri_or_path # fsspec.filesystem will throw RuntimeError if the protocol is unsupported - if self.protocol == "s3" and app_config.data_locator__s3__region_name: + if self.protocol == "s3" and app_config and app_config.data_locator__s3__region_name: self.fs = fsspec.filesystem( self.protocol, config_kwargs={"region_name": app_config.data_locator__s3__region_name} )