Pass kwargs to exception to get better format of error message
If we do not pass kwargs to exception, the parameter will be deemed as message and will be displayed directly. This is to pass kwargs to MultipleHostsFound and UnsupportedResourceType, to get better format of error message. Change-Id: Ib40ee68249b34f3e83100c5da8d30e13ff820dfa
This commit is contained in:
@@ -480,7 +480,7 @@ class NovaInventory(NovaClientWrapper):
|
||||
except nova_exception.NotFound:
|
||||
raise manager_exceptions.HostNotFound(host=host)
|
||||
if len(hypervisors_list) > 1:
|
||||
raise manager_exceptions.MultipleHostsFound(host)
|
||||
raise manager_exceptions.MultipleHostsFound(host=host)
|
||||
else:
|
||||
hypervisor_id = hypervisors_list[0].id
|
||||
# NOTE(sbauza): No need to catch the exception as we're sure
|
||||
@@ -523,7 +523,7 @@ class NovaInventory(NovaClientWrapper):
|
||||
except nova_exception.NotFound:
|
||||
raise manager_exceptions.HostNotFound(host=host)
|
||||
if len(hypervisors_list) > 1:
|
||||
raise manager_exceptions.MultipleHostsFound(host)
|
||||
raise manager_exceptions.MultipleHostsFound(host=host)
|
||||
else:
|
||||
try:
|
||||
return hypervisors_list[0].servers
|
||||
|
||||
Reference in New Issue
Block a user