launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #22709
Re: [Merge] lp:~cjwatson/launchpad/treq into lp:launchpad
Diff comments:
>
> === modified file 'lib/lp/snappy/model/snapbuildbehaviour.py'
> --- lib/lp/snappy/model/snapbuildbehaviour.py 2018-05-02 12:45:12 +0000
> +++ lib/lp/snappy/model/snapbuildbehaviour.py 2018-07-02 00:28:14 +0000
> @@ -152,18 +152,14 @@
> build_id=self.build.build_cookie,
> timestamp=timestamp)
> auth_string = '{}:{}'.format(admin_username, secret).strip()
> - auth_header = 'Basic ' + base64.b64encode(auth_string)
> - data = json.dumps({'username': proxy_username})
> + auth_header = b'Basic ' + base64.b64encode(auth_string)
>
> - result = yield getPage(
> - url,
> - method='POST',
> - postdata=data,
> - headers={
> - 'Authorization': auth_header,
> - 'Content-Type': 'application/json'}
> - )
> - token = json.loads(result)
> + response = yield treq.post(
> + url, headers={'Authorization': auth_header},
> + json={'username': proxy_username},
> + reactor=self._slave.reactor,
> + pool=self._slave.pool).addCallback(check_status)
> + token = yield treq.json_content(response)
Mostly just for prettier code layout, but I don't really mind. Changed.
In the dim and distant future asyncio will save us.
> defer.returnValue(token)
>
> def verifySuccessfulBuild(self):
--
https://code.launchpad.net/~cjwatson/launchpad/treq/+merge/348808
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
References