Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions exoscale/api/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,17 @@ def _call_operation(self, operation_id, parameters=None, body=None):
# TODO validate
json["json"] = body

response = self.http_client.request(
method=op["verb"].upper(), url=url, params=query_params, **json
)
# list-zones returns public data but the server enforces IAM role policies
# on authenticated requests — restricted keys (e.g. DBaaS-only) get 403.
# Send the request without credentials so it always succeeds.
if operation_id == "list-zones":
response = requests.request(
method=op["verb"].upper(), url=url, params=query_params, **json
)
else:
response = self.http_client.request(
method=op["verb"].upper(), url=url, params=query_params, **json
)

# Error handling
if response.status_code == 403:
Expand Down
Loading