From e04262ada8301b0e48e976dd01c0351cf87eb91d Mon Sep 17 00:00:00 2001 From: Wasil Siargiejczyk Date: Thu, 28 Nov 2019 12:12:01 +0500 Subject: [PATCH] fix a bug in the search_engine method this bug made `search_engine` method virtually unusable, because it generated incorrect search URL. made `%` instead of `format` function, as everywhere else in the code. --- glpi/glpi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glpi/glpi.py b/glpi/glpi.py index 9e67b45..86b3bce 100644 --- a/glpi/glpi.py +++ b/glpi/glpi.py @@ -737,7 +737,7 @@ def search_engine(self, item_name, criteria): # build searchtype argument # -> optional! defaults to "contains" on the server if empty if 'searchtype' in c and c['searchtype'] is not None: - uri = (uri + "&criteria[%d][searchtype]=%s".format(idx, + uri = (uri + "&criteria[%d][searchtype]=%s" % (idx, c['searchtype'])) else: uri = uri + "&criteria[%d][searchtype]=" % (idx)