Skip to content

Commit

Permalink
fixed MAZ-3149 - bug in handling query params that caused long iterat…
Browse files Browse the repository at this point in the history
…ions on alerts to fail
  • Loading branch information
Imri Goldberg committed Jul 16, 2017
1 parent b9cbcd2 commit 0ba3dcd
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion mazerunner/api_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import urlparse
from httplib import NO_CONTENT
import shutil
from numbers import Number
Expand All @@ -14,7 +15,7 @@ class BaseCollection(object):

def __init__(self, api_client, obj_class=None):
"""
:param api_client: The connection instance.
:param api_client: The connection instance.
:param obj_class: The class, instance of which all the members should be.
"""
self._api_client = api_client
Expand Down Expand Up @@ -1417,6 +1418,22 @@ def api_request(self,
if not url.startswith("http"):
url = self._base_url + url

parsed = urlparse.urlparse(url)
parsed_no_query = urlparse.ParseResult(
scheme=parsed.scheme,
netloc=parsed.netloc,
path=parsed.path,
params=parsed.params,
query='',
fragment=parsed.fragment)
url = urlparse.urlunparse(parsed_no_query)
query = {query_param_name: set(query_param_value)
for query_param_name, query_param_value
in urlparse.parse_qs(parsed.query).items()}
if query_params:
query.update(query_params)
query_params = query

request_args = dict(
method=method,
url=url,
Expand Down

0 comments on commit 0ba3dcd

Please sign in to comment.