unistra / python-glpi-api

Python module for interacting with GLPI using the API.
GNU General Public License v3.0
18 stars 10 forks source link

Criteria building modifies input dict #10

Closed jplitza closed 2 years ago

jplitza commented 2 years ago
>>> criteria = [{"link": "AND", "criteria": [{"field": "Computer.name", "searchtype": "contains", "value": "example.com"}]}]
>>> glpi.search("Computer", criteria=criteria)
# returns the expected result
>>> print(criteria)
[{"link": "AND"}]

This is a problem when the input criteria are supposed to be used for another invocation, like when you have children groups in an Ansible GLPI inventory.

I'll open a PR fixing this in a minute.