Skip to content

Commit

Permalink
fix for hs_api_key not picked up from .hscfg
Browse files Browse the repository at this point in the history
  • Loading branch information
jreadey committed Apr 13, 2021
1 parent 4e917d4 commit 071d6f7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion h5pyd/_hl/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def __init__(self, config_file=None, **kwargs):
continue
k = line[:index].strip()
v = line[(index+1):].strip()
self._cfg[k] = v
if v and v.upper() != "NONE":
self._cfg[k] = v
# override any config values with environment variable if found
for k in self._cfg.keys():
if k.upper() in os.environ:
Expand Down
4 changes: 3 additions & 1 deletion h5pyd/_hl/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ def __init__(self, domain, mode=None, endpoint=None, username=None, password=Non
password = os.environ["H5SERV_PASSWORD"]
elif "hs_password" in cfg:
password = cfg["hs_password"]

if api_key is None and "hs_api_key" in cfg:
api_key = cfg["hs_api_key"]

if bucket is None:
if "HS_BUCKET" in os.environ:
Expand Down Expand Up @@ -329,7 +332,6 @@ def __init__(self, domain, mode=None, endpoint=None, username=None, password=Non
self._lastScan = None # when summary stats where last updated by server
self._dn_ids = dn_ids


Group.__init__(self, self._id)

def _getVerboseInfo(self):
Expand Down
3 changes: 3 additions & 0 deletions h5pyd/_hl/folders.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ def __init__(self, domain_name, pattern=None, query=None, mode=None, endpoint=No
if password is None and "hs_password" in cfg:
password = cfg["hs_password"]

if api_key is None and "hs_api_key" in cfg:
api_key = cfg["hs_api_key"]

if bucket is None and "hs_bucket" in cfg:
bucket = cfg["hs_bucket"]

Expand Down

0 comments on commit 071d6f7

Please sign in to comment.