Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make instance.refresh() avoid recursion better
The instance.refresh() method is careful to prevent recursion, to avoid lazy-loads on the object we just pulled from the database. However, it was allowing those to raise OrphanedObjectError to the caller to make them visible. The caller is not really at fault in that case, and can not avoid it. The only time this has ever come up is in the context of cellsv1 and the keypairs field that it doesn't have set on instances in the child cells. Thus, this changes refresh() to just skip fields that are set on the current object and unset on the one we pull from the database, as we would not be able to refresh those anyway. This logs the situation so that it is visible (at DEBUG) if it becomes relevant. Change-Id: Ibfca4ae922766b5b977e217594d12e1169ddeee8
- Loading branch information