Improve log message on exception for invalid tunnel type

When a tunnel with an invalid or unsupported type is to be created an
exception is raised but does not contain info for the offending host.
Add the host info and tunnel ip address to the exception error message
for better debugging

Change-Id: Id989f20043c252ff61ab9a6ee227e8c9c7c5029b
Closes-Bug: #1863888
This commit is contained in:
Alexandros Soumplis 2020-02-19 14:02:25 +02:00 committed by Brian Haley
parent 252d42a3a5
commit e4de8d0dd3
1 changed files with 5 additions and 1 deletions

View File

@ -563,7 +563,11 @@ class TunnelRpcCallbackMixin(object):
# Return the list of tunnels IP's to the agent
return entry
else:
msg = _("Network type value '%s' not supported") % tunnel_type
msg = (_("Network type value %(type)s not supported, "
"host: %(host)s with tunnel IP: %(ip)s") %
{'type': tunnel_type,
'host': host or 'legacy mode (no host provided by agent)',
'ip': tunnel_ip})
raise exc.InvalidInput(error_message=msg)