mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
ffcdc53536
In query_resource_by_key(), there is an equal comparison that is made to know if the object we are looking for is present. Due to type difference this comparison doesn't always retrieve true, even when it should. This is due to the fact that the value in r_data dict are of type unicode, while the other can be of type int, float,... . ``` >>> a = u'1' >>> type(a) <type 'unicode'> >>> b = 1 >>> type(b) <type 'int'> >>> a == b False >>> str(a) == str(b) True ``` Hence the values, for comparison purposes, are casted into strings. |
||
---|---|---|
.. | ||
ansible |