Merge "Ensure that correct exception is raised"
This commit is contained in:
commit
8f238e0b71
@ -157,12 +157,12 @@ class NsxLibApiBase(object):
|
||||
err_msg = (_("Could not find %(resource)s %(name)s") %
|
||||
{'name': name_or_id, 'resource': resource})
|
||||
# TODO(aaron): improve exception handling...
|
||||
raise exceptions.ManagerError(details=err_msg)
|
||||
raise nsxlib_exceptions.ManagerError(details=err_msg)
|
||||
elif len(matched_results) > 1:
|
||||
err_msg = (_("Found multiple %(resource)s named %(name)s") %
|
||||
{'name': name_or_id, 'resource': resource})
|
||||
# TODO(aaron): improve exception handling...
|
||||
raise exceptions.ManagerError(details=err_msg)
|
||||
raise nsxlib_exceptions.ManagerError(details=err_msg)
|
||||
|
||||
return matched_results[0].get('id')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user