Ovirt correct resloving false atrs backport (#63953)

* ovirt correct resolving nested atributes which are false (#63908)

* add changelog
pull/64756/head
Martin Nečas 6 years ago committed by Matt Clay
parent 13db4b90a5
commit 49f1760fea

@ -0,0 +1,2 @@
bugfixes:
- "Ovirt correct resolving nested atributes which are false."

@ -69,7 +69,7 @@ def get_dict_of_struct(struct, connection=None, fetch_nested=False, attributes=N
value = None value = None
nested_obj = dict( nested_obj = dict(
(attr, convert_value(getattr(value, attr))) (attr, convert_value(getattr(value, attr)))
for attr in attributes if getattr(value, attr, None) for attr in attributes if getattr(value, attr, None) is not None
) )
nested_obj['id'] = getattr(value, 'id', None) nested_obj['id'] = getattr(value, 'id', None)
nested_obj['href'] = getattr(value, 'href', None) nested_obj['href'] = getattr(value, 'href', None)

Loading…
Cancel
Save