Skip to content

Commit

Permalink
mlb: fix event stream subscription params
Browse files Browse the repository at this point in the history
Though a series of updated pr's the `plan-format=light` param was lost.
Add it back in.

Fixes: d2iq-archive#642
  • Loading branch information
jkoelker committed Jul 24, 2019
1 parent ecaefae commit 5e359ca
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions marathon_lb.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,15 @@ def tasks(self):

def get_event_stream(self, events):
self.current_host = self.host
url = self.current_host + "/v2/events"
params = {
'plan-format': 'light'
}
if events:
url += "?" + urllib.parse.urlencode({'event_type': events},
doseq=True)
params['event_type'] = events

url_params = urllib.parse.urlencode(params, doseq=True)
url = '{}/v2/events?{}'.format(self.current_host, url_params)

return CurlHttpEventStream(url, self.__auth, self.__verify)

def iter_events(self, stream):
Expand Down

0 comments on commit 5e359ca

Please sign in to comment.