Skip to content

Commit 1125097

Browse files
authored
Update send.py
Revert await response.json() to circumvent new warnings; call response.json() directly when forming the message.
1 parent 2b7a09f commit 1125097

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lightbeam/send.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ async def do_post(self, endpoint, file_name, data, client, line, hash):
165165
data=data,
166166
ssl=self.lightbeam.config["connection"]["verify_ssl"],
167167
headers=self.lightbeam.api.headers) as response:
168-
body = await response.json()
168+
body = await response.text()
169169
status = response.status
170170
if status!=401:
171171
# update status_counts (for every-second status update)
@@ -174,7 +174,7 @@ async def do_post(self, endpoint, file_name, data, client, line, hash):
174174

175175
# warn about errors
176176
if response.status not in [ 200, 201 ]:
177-
message = str(response.status) + ": " + util.linearize(body.get("message"))
177+
message = str(response.status) + ": " + util.linearize(response.json().get("message"))
178178

179179
# update run metadata...
180180
failed_statuses_dict = self.metadata["resources"][endpoint].get("failed_statuses", {})

0 commit comments

Comments
 (0)