From 161a59e2747fb41faaf226e1b0f451a59af3a2b9 Mon Sep 17 00:00:00 2001 From: Eyal Date: Sun, 28 Jun 2020 15:24:35 +0300 Subject: [PATCH] Use vars() more readable then __dict__ Change-Id: Ibf32b59f078c4258d01c298068507d7fa22a9715 --- vitrage_tempest_plugin/tests/common/cinder_utils.py | 4 ++-- vitrage_tempest_plugin/tests/common/general_utils.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vitrage_tempest_plugin/tests/common/cinder_utils.py b/vitrage_tempest_plugin/tests/common/cinder_utils.py index 9228a84..1434b59 100644 --- a/vitrage_tempest_plugin/tests/common/cinder_utils.py +++ b/vitrage_tempest_plugin/tests/common/cinder_utils.py @@ -47,6 +47,6 @@ def _check_num_volumes(num_volumes=0, state=''): if len(TempestClients.cinder().volumes.list()) != num_volumes: return False - return all(volume.__dict__['status'].upper() == state.upper() and - len(volume.__dict__['attachments']) == 1 + return all(vars(volume)['status'].upper() == state.upper() and + len(vars(volume)['attachments']) == 1 for volume in TempestClients.cinder().volumes.list()) diff --git a/vitrage_tempest_plugin/tests/common/general_utils.py b/vitrage_tempest_plugin/tests/common/general_utils.py index 9793b97..42c2cb3 100644 --- a/vitrage_tempest_plugin/tests/common/general_utils.py +++ b/vitrage_tempest_plugin/tests/common/general_utils.py @@ -32,7 +32,7 @@ def is_subset(subset, full): return True full_dict = full if type(full) is not dict: - full_dict = full.__dict__ + full_dict = vars(full) return six.viewitems(subset) <= six.viewitems(full_dict)