Avoid using hasattr() on troveclient resources for py3 porting
troveclient resources use the lazy-loading feature, which causes problems
for calling hasttr() on the object. copy.deepcopy() also use hasattr(),
and results in infinite loops. hasattr() will ignore any exceptions under
Python 2.x, but reraise them under Python 3, this is reason why the related
test cases passed under Python 2.x and keep failing under Python 3. This
patch fixes and should be the last one to fix the py35 gate jobs.
Reviewed: https:/ /review. openstack. org/553428 /git.openstack. org/cgit/ openstack/ trove-dashboard /commit/ ?id=721da6ac3e3 4f98606672c0f3f 52a240e96cb860
Committed: https:/
Submitter: Zuul
Branch: master
commit 721da6ac3e34f98 606672c0f3f52a2 40e96cb860
Author: Zhao Chao <email address hidden>
Date: Thu Mar 15 22:50:47 2018 +0800
Avoid using hasattr() on troveclient resources for py3 porting
troveclient resources use the lazy-loading feature, which causes problems
for calling hasttr() on the object. copy.deepcopy() also use hasattr(),
and results in infinite loops. hasattr() will ignore any exceptions under
Python 2.x, but reraise them under Python 3, this is reason why the related
test cases passed under Python 2.x and keep failing under Python 3. This
patch fixes and should be the last one to fix the py35 gate jobs.
Partial-Bug: #1755413
Change-Id: I97492605047a98 6d3075a8b5f22ec bfdb3af8aca
Signed-off-by: Zhao Chao <email address hidden>