objects: use correct object class name in NeutronPrimaryKeyMissing
We were passing cls.__class__ as the object type into the exception error message. But in case of DeclarativeObject based classes (all NeutronDbObject classes), the result of it is a message like: neutron.objects.base.NeutronPrimaryKeyMissing: For class DeclarativeObject missing primary keys: set([]) Note the class name is DeclarativeObject, not the intented object class name. Change-Id: I005512b4edf6e4c68a803f4180983e4a01e4f036
This commit is contained in:
parent
5a30c0f858
commit
e39a61b605
@ -387,7 +387,7 @@ class NeutronDbObject(NeutronObject):
|
||||
all_keys = itertools.chain([cls.primary_keys], cls.unique_keys)
|
||||
if not any(lookup_keys.issuperset(keys) for keys in all_keys):
|
||||
missing_keys = set(cls.primary_keys).difference(lookup_keys)
|
||||
raise NeutronPrimaryKeyMissing(object_class=cls.__class__,
|
||||
raise NeutronPrimaryKeyMissing(object_class=cls.__name__,
|
||||
missing_keys=missing_keys)
|
||||
|
||||
with db_api.autonested_transaction(context.session):
|
||||
|
Loading…
Reference in New Issue
Block a user