This is an automated email from the ASF dual-hosted git repository.
kmarlis pushed a commit to branch SDAP-515
in repository https://gitbox.apache.org/repos/asf/sdap-nexus.git
The following commit(s) were added to refs/heads/SDAP-515 by this push:
new f504f2a Further fixes for unreachable remote SDAPs
f504f2a is described below
commit f504f2af4aae6a4ea4a60ac2db597ec4539feb52
Author: kevinmarlis <[email protected]>
AuthorDate: Thu May 2 09:40:16 2024 -0700
Further fixes for unreachable remote SDAPs
---
CHANGELOG.md | 2 ++
analysis/webservice/algorithms/DataSeriesList.py | 6 ++----
analysis/webservice/redirect/RemoteSDAPCache.py | 10 +++++-----
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5ad70cd..1531d34 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -25,6 +25,8 @@ and this project adheres to [Semantic
Versioning](https://semver.org/spec/v2.0.0
- SDAP-493:
- Removed `resultSizeLimit` from /match_spark endpoint
### Fixed
+- SDAP-515:
+ - Improved error handling with connections to remote SDAP deployments
### Security
## [1.2.0] - 2023-11-22
diff --git a/analysis/webservice/algorithms/DataSeriesList.py
b/analysis/webservice/algorithms/DataSeriesList.py
index e247bb6..31e07e6 100644
--- a/analysis/webservice/algorithms/DataSeriesList.py
+++ b/analysis/webservice/algorithms/DataSeriesList.py
@@ -68,10 +68,8 @@ class DataSeriesListCalcHandlerImpl(NexusCalcHandler):
)
del remote_collection['shortName']
current_collection.update(remote_collection)
-
- except CollectionNotFound as e:
- logger.warning(e)
- finally:
collection_list.append(current_collection)
+ except CollectionNotFound as e:
+ logger.warning(e)
return SimpleResult(collection_list)
diff --git a/analysis/webservice/redirect/RemoteSDAPCache.py
b/analysis/webservice/redirect/RemoteSDAPCache.py
index 9c9d658..9bcdc4d 100644
--- a/analysis/webservice/redirect/RemoteSDAPCache.py
+++ b/analysis/webservice/redirect/RemoteSDAPCache.py
@@ -57,9 +57,9 @@ class RemoteSDAPCache:
stripped_url = url.strip('/')
if stripped_url not in self.sdap_lists or
self.sdap_lists[stripped_url].outdated_at>datetime.now():
self._add(stripped_url)
-
- for collection in self.sdap_lists[stripped_url].list:
- if 'shortName' in collection and collection['shortName'] ==
short_name:
- return collection
-
+ if stripped_url in self.sdap_lists:
+ for collection in self.sdap_lists[stripped_url].list:
+ if 'shortName' in collection and collection['shortName'] ==
short_name:
+ return collection
+
raise CollectionNotFound(f"collection {short_name} has not been found
in url {stripped_url}")
\ No newline at end of file