diff --git a/ironicclient/common/http.py b/ironicclient/common/http.py index b78c5a673..9fab68bec 100644 --- a/ironicclient/common/http.py +++ b/ironicclient/common/http.py @@ -118,7 +118,11 @@ class VersionNegotiationMixin(object): str(self.os_ironic_api_version).split('.')[0]) else: base_version = API_VERSION - return self._make_simple_request(conn, 'GET', base_version) + # Raise exception on client or server error. + resp = self._make_simple_request(conn, 'GET', base_version) + if not resp.ok: + raise exc.from_response(resp, method='GET', url=base_version) + return resp version_overridden = False diff --git a/releasenotes/notes/fix-negotiate-version-503-c3cb8d1d4901541a.yaml b/releasenotes/notes/fix-negotiate-version-503-c3cb8d1d4901541a.yaml new file mode 100644 index 000000000..0b13e2557 --- /dev/null +++ b/releasenotes/notes/fix-negotiate-version-503-c3cb8d1d4901541a.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + Fixes an issue where some failure modes of communication with the Ironic + API could result in an exception that circumvents the client's retry + mechanisms. In particular this includes HTTP 503 service unavailable which + is seen when Ironic operates behind a load balancer, and no backend is + available to handle the request.