File tree Expand file tree Collapse file tree 2 files changed +18
-8
lines changed
fsspec-proxy/fsspec_proxy Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change 22import fsspec .utils
33import io
44import os
5- import pkgutil
65import yaml
76import logging
87
98logger = logging .getLogger ("fsspec_proxy" )
10-
9+ default_config = b"""sources:
10+ - name: inmemory
11+ path: memory://mytests
12+ - name: local
13+ path: file:///Users
14+ readonly: true
15+ - name: "Conda Stats"
16+ path: "s3://anaconda-package-data/conda/hourly/"
17+ kwargs:
18+ anon: True
19+ - name: "MyAnaconda"
20+ path: "anaconda://my/"
21+ allow_reload: true
22+ """
1123
1224class FileSystemManager :
1325 def __init__ (self , config_path = None ):
1426 self .filesystems = {}
15- if config_path is None and "FSSPEC_PROXY_CONFIG" in os .environ :
16- self .config = self .load_config (os .getenv ("FSSPEC_PROXY_CONFIG" ))
17- else :
18- self .config = self .load_config ()
27+ config_path = config_path or os .getenv ("FSSPEC_PROXY_CONFIG" , None )
28+ self .config = self .load_config (config_path )
1929 self .initialize_filesystems ()
2030
2131 def load_config (self , config_path = None ):
2232 if config_path is None :
23- data = pkgutil . get_data ( __name__ , "config.yaml" )
33+ data = default_config
2434 elif not os .path .exists (config_path ):
2535 return {}
2636 else :
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ def server():
1717 try :
1818 requests .get (f"{ s } /health" )
1919 break
20- except Exception :
20+ except BaseException :
2121 if count < 0 :
2222 raise
2323 count -= 1
You can’t perform that action at this time.
0 commit comments