Skip to content

Commit 48423e2

Browse files
committed
Fix http error reporting and json metadata handling
Raise on unsuccessful HTTP responses during Bandersnatch requests so errors are reported directly instead of being misclassified as stale metadata. Also allow deserialized json list values when rendering python package metadata.
1 parent 5b76249 commit 48423e2

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed python syncs masking HTTP errors as stale metadata and handling native json list values in package metadata

‎pulp_python/app/tasks/sync.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ async def run(self):
130130
auth=downloader.auth,
131131
proxy=downloader.proxy,
132132
proxy_auth=downloader.proxy_auth,
133+
raise_for_status=True,
133134
)
134135

135136
deferred_download = self.remote.policy != Remote.IMMEDIATE

‎pulp_python/app/utils.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ def json_to_dict(data):
441441
dictionary: of JSON string
442442
443443
"""
444-
if isinstance(data, dict):
444+
if isinstance(data, (dict, list)):
445445
return data
446446

447447
return json.loads(data)

0 commit comments

Comments
 (0)