diff options
author | Zuul <zuul@review.opendev.org> | 2020-08-24 14:44:15 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2020-08-24 14:44:15 +0000 |
commit | 3669e26ed964c8dabbc60eb248d18b8bf0c5c7a0 (patch) | |
tree | 8050561ff0149320b2dcda29b993ed184ba242be | |
parent | a5eaf207825951edea3630abea6c0f7d3a0992cf (diff) | |
parent | 8f8d4286b3d5b02bb6447a27536a2eb93f97f740 (diff) | |
download | ironic-python-agent-3669e26ed964c8dabbc60eb248d18b8bf0c5c7a0.tar.gz |
Merge "improve error messages during node lookup failures" into stable/rocky
-rw-r--r-- | ironic_python_agent/ironic_api_client.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/ironic_python_agent/ironic_api_client.py b/ironic_python_agent/ironic_api_client.py index 20779871..cadd6876 100644 --- a/ironic_python_agent/ironic_api_client.py +++ b/ironic_python_agent/ironic_api_client.py @@ -148,12 +148,19 @@ class APIClient(object): 'GET', self.lookup_api, headers=self._get_ironic_api_version_header(), params=params) - except Exception: - LOG.exception('Lookup failed') + except Exception as err: + LOG.exception( + 'Unhandled error looking up node with addresses %r at %s: %s', + params['addresses'], self.api_url, err, + ) return False if response.status_code != requests.codes.OK: - LOG.warning('Failure status code: %s', response.status_code) + LOG.warning( + 'Failed looking up node with addresses %r at %s, ' + 'status code: %s', + params['addresses'], self.api_url, response.status_code, + ) return False try: @@ -164,7 +171,11 @@ class APIClient(object): # Check for valid response data if 'node' not in content or 'uuid' not in content['node']: - LOG.warning('Got invalid node data from the API: %s', content) + LOG.warning( + 'Got invalid node data in response to query for node ' + 'with addresses %r from %s: %s', + params['addresses'], self.api_url, content, + ) return False if 'config' not in content: |