show inspection callback url in error messages

We have seen issues in misconfigured systems where messages from IPA
to ironic-inspector fail with 404 or other standard HTTP error
codes. Although there is an info message reporting the URL, the error
messages do not include the URL of the service IPA is trying to talk
to, which makes debugging the configuration difficult. This change
adds the URL to the error already being reported to improve that
situation.

Change-Id: Ib092ac690d29c385c0564c086ad2fec3df0fb2e0
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2019-05-13 10:31:02 -04:00
parent 21393cb1c5
commit a2d25de639
1 changed files with 2 additions and 1 deletions

View File

@ -117,7 +117,8 @@ def call_inspector(data, failures):
resp = requests.post(CONF.inspection_callback_url, data=data,
verify=verify, cert=cert)
if resp.status_code >= 400:
LOG.error('inspector error %d: %s, proceeding with lookup',
LOG.error('inspector %s error %d: %s, proceeding with lookup',
CONF.inspection_callback_url,
resp.status_code, resp.content.decode('utf-8'))
return