Use vars() more readable then __dict__
Change-Id: Ibf32b59f078c4258d01c298068507d7fa22a9715
This commit is contained in:
parent
27feeadf4b
commit
161a59e274
@ -47,6 +47,6 @@ def _check_num_volumes(num_volumes=0, state=''):
|
|||||||
if len(TempestClients.cinder().volumes.list()) != num_volumes:
|
if len(TempestClients.cinder().volumes.list()) != num_volumes:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return all(volume.__dict__['status'].upper() == state.upper() and
|
return all(vars(volume)['status'].upper() == state.upper() and
|
||||||
len(volume.__dict__['attachments']) == 1
|
len(vars(volume)['attachments']) == 1
|
||||||
for volume in TempestClients.cinder().volumes.list())
|
for volume in TempestClients.cinder().volumes.list())
|
||||||
|
@ -32,7 +32,7 @@ def is_subset(subset, full):
|
|||||||
return True
|
return True
|
||||||
full_dict = full
|
full_dict = full
|
||||||
if type(full) is not dict:
|
if type(full) is not dict:
|
||||||
full_dict = full.__dict__
|
full_dict = vars(full)
|
||||||
return six.viewitems(subset) <= six.viewitems(full_dict)
|
return six.viewitems(subset) <= six.viewitems(full_dict)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user