Patch I253123d5451b32f0e3143916e41aaa1af75561c2 fixed the
DetachedInstanceError for VolumeAttachment OVOs but only partially, as
apparently it was dependent on the SQLAlchemy version due to the use os
"hasattr".
This patch replaces "hasattr" with a check on the object's dictionary,
which will never trigger a Lazy Load.
Closes-Bug: #1834845
Change-Id: Iac785eef9be4b9cdb5c739ee0a87949805282867
(cherry picked from commit 2e73bede80)
(cherry picked from commit 44a15be6a7)
Conflicts:
cinder/tests/unit/volume/drivers/test_lvm_driver.py
(cherry picked from commit eabf648b7a)