Skip to content

Handle named errors when checking S3 buckets - #10647

Open
Shubham-Padkonde wants to merge 1 commit into
aws:v2from
Shubham-Padkonde:fix/s3-named-error-code
Open

Shubham-Padkonde wants to merge 1 commit into
aws:v2from
Shubham-Padkonde:fix/s3-named-error-code

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown

s3_bucket_exists converts every S3 error code to an integer. Named codes such as NoSuchBucket and AccessDenied therefore raise ValueError, interrupting the bucket check used by aws configservice subscribe.

Use the response HTTP status when available and compare its string representation with 404. Preserve the existing numeric-code fallback and non-404 behavior.

Tests: three new regressions fail on the base revision; all 40 tests in test_utils.py and configservice/test_subscribe.py pass after the change. Tests used mocked requests, dummy credentials, and disabled EC2 metadata access. No live AWS requests were needed.

Generated by AI tools (Codex). Human review: [add your name after reviewing, before submitting, as required by CONTRIBUTING.rst].

@Shubham-Padkonde
Shubham-Padkonde requested a review from a team as a code owner September 16, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant