Merge "Add type information to ObjectNotFound message"
This commit is contained in:
commit
36a3e127c0
@ -56,9 +56,9 @@ def _safe_get_object(context, model, **kwargs):
|
||||
db_obj = get_object(context, model, **kwargs)
|
||||
|
||||
if db_obj is None:
|
||||
key = "".join(['%s:: %s ' % (key, value) for (key, value)
|
||||
in kwargs.items()])
|
||||
raise n_exc.ObjectNotFound(id=key)
|
||||
key = ", ".join(['%s=%s' % (key, value) for (key, value)
|
||||
in kwargs.items()])
|
||||
raise n_exc.ObjectNotFound(id="%s(%s)" % (model.__name__, key))
|
||||
return db_obj
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user