mirror of
https://github.com/GNS3/gns3-server
synced 2025-04-21 01:49:00 +00:00
Fix Docker logs decoding. Ref #2522
This commit is contained in:
parent
ca34053125
commit
ffd628902c
@ -173,11 +173,10 @@ class Docker(BaseManager):
|
||||
response = await self.http_query(method, path, data=data, params=params)
|
||||
body = await response.read()
|
||||
response.close()
|
||||
if body and len(body):
|
||||
if response.headers.get('CONTENT-TYPE') == 'application/json':
|
||||
body = json.loads(body.decode("utf-8"))
|
||||
else:
|
||||
body = body.decode("utf-8")
|
||||
if response.headers.get('CONTENT-TYPE') == 'application/json':
|
||||
body = json.loads(body.decode("utf-8", errors="ignore"))
|
||||
else:
|
||||
body = body.decode("utf-8", errors="ignore")
|
||||
log.debug("Query Docker %s %s params=%s data=%s Response: %s", method, path, params, data, body)
|
||||
return body
|
||||
|
||||
|
@ -1203,7 +1203,7 @@ class DockerVM(BaseNode):
|
||||
"""
|
||||
|
||||
result = await self.manager.query("GET", "containers/{}/logs".format(self._cid), params={"stderr": 1, "stdout": 1})
|
||||
return result.decode('utf-8', errors='ignore').strip()
|
||||
return result
|
||||
|
||||
async def delete(self):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user