Skip to content

Commit

Permalink
Sanity check in portal_utils.Portal constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmichaels-harvard committed Jan 4, 2024
1 parent 10a421d commit 844bf1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions dcicutils/portal_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ def init_from_key(key: dict, server: Optional[str], unspecified: Optional[list]
self._key_pair = (key_id, secret)
if ((isinstance(server, str) and server) or (isinstance(server := key.get("server"), str) and server)):
if server := normalize_server(server):
if isinstance(key_server := key.get("server"), str) and key_server and key_server != server:
raise Exception(f"Portal server inconsistency: {server} vs {key_server}")
self._key["server"] = self._server = server
if not self._key:
raise Exception("Portal init error; from key.")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dcicutils"
version = "8.7.0.1b5" # TODO: To become 8.7.1
version = "8.7.0.1b6" # TODO: To become 8.7.1
description = "Utility package for interacting with the 4DN Data Portal and other 4DN resources"
authors = ["4DN-DCIC Team <support@4dnucleome.org>"]
license = "MIT"
Expand Down

0 comments on commit 844bf1b

Please sign in to comment.