Browse Source

Use vars() more readable then __dict__

Change-Id: Ibf32b59f078c4258d01c298068507d7fa22a9715
changes/53/738353/1
Eyal 1 week ago
parent
commit
161a59e274
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      vitrage_tempest_plugin/tests/common/cinder_utils.py
  2. +1
    -1
      vitrage_tempest_plugin/tests/common/general_utils.py

+ 2
- 2
vitrage_tempest_plugin/tests/common/cinder_utils.py View File

@@ -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())

+ 1
- 1
vitrage_tempest_plugin/tests/common/general_utils.py View File

@@ -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)




Loading…
Cancel
Save