summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2023-04-04 12:35:28 +0000
committerGerrit Code Review <review@openstack.org>2023-04-04 12:35:28 +0000
commit17cabc4b81b962e1bfac0234607dd8f21ad65b01 (patch)
tree237847bef8e29bec82755ffcbd278940ed6732c5
parentabbd859b766c339f5de33ff08704a7b9ad045bef (diff)
parent21437135ab3a8c9aa2fea99c48ab42eb45630941 (diff)
downloadironic-17cabc4b81b962e1bfac0234607dd8f21ad65b01.tar.gz
Merge "Add error logging on lookup failures in the API"
-rw-r--r--ironic/api/controllers/v1/ramdisk.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ironic/api/controllers/v1/ramdisk.py b/ironic/api/controllers/v1/ramdisk.py
index 5feef5e02..b98eb7dc2 100644
--- a/ironic/api/controllers/v1/ramdisk.py
+++ b/ironic/api/controllers/v1/ramdisk.py
@@ -131,13 +131,17 @@ class LookupController(rest.RestController):
else:
node = objects.Node.get_by_port_addresses(
api.request.context, valid_addresses)
- except exception.NotFound:
+ except exception.NotFound as e:
# NOTE(dtantsur): we are reraising the same exception to make sure
# we don't disclose the difference between nodes that are not found
# at all and nodes in a wrong state by different error messages.
+ LOG.error('No node has been found during lookup: %s', e)
raise exception.NotFound()
if CONF.api.restrict_lookup and not self.lookup_allowed(node):
+ LOG.error('Lookup is not allowed for node %(node)s in the '
+ 'provision state %(state)s',
+ {'node': node.uuid, 'state': node.provision_state})
raise exception.NotFound()
if api_utils.allow_agent_token():