Previously, it was possible for None to be passed to context.session.delete()
if a port was not found (usually a result of a concurrent delete). This
resulted in an UnmappedInstanceError. This is avoided now by calling
query.delete() directly which does not raise any exceptions.
Change-Id: I3b9f513308d90874ac8e8a7f6345697978d4920f
Closes-bug: #
1496554
enable_eagerloads(False).filter_by(id=port_id))
if not context.is_admin:
query = query.filter_by(tenant_id=context.tenant_id)
- context.session.delete(query.first())
+ query.delete(synchronize_session=False)
def _save_subnet(self, context,
network,