From 5de57816ddeac42cfee3780d3e0d68f023ede272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 18 Dec 2018 15:29:40 +0100 Subject: [PATCH] chg: Pass all parameters to the search API. --- pymisp/api.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pymisp/api.py b/pymisp/api.py index 65174e7..b66eae0 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -1231,12 +1231,14 @@ class PyMISP(object): query['event_timestamp'] = kwargs.pop('event_timestamp', None) query['includeProposals'] = kwargs.pop('includeProposals', None) + if kwargs: + self.logger.info('Some unknown parameters are in kwargs. appending as-is: {}'.format(', '.join(kwargs.keys()))) + # Add all other keys as-is. + query.update({k: v for k, v in kwargs.items()}) + # Cleanup query = {k: v for k, v in query.items() if v is not None} - if kwargs: - raise SearchError('Unused parameter: {}'.format(', '.join(kwargs.keys()))) - # Create a session, make it async if and only if we have a callback return self.__query('restSearch/download', query, controller, async_callback)