mirror of
https://github.com/GNS3/gns3-server
synced 2025-07-25 07:58:08 +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)
|
response = await self.http_query(method, path, data=data, params=params)
|
||||||
body = await response.read()
|
body = await response.read()
|
||||||
response.close()
|
response.close()
|
||||||
if body and len(body):
|
if response.headers.get('CONTENT-TYPE') == 'application/json':
|
||||||
if response.headers.get('CONTENT-TYPE') == 'application/json':
|
body = json.loads(body.decode("utf-8", errors="ignore"))
|
||||||
body = json.loads(body.decode("utf-8"))
|
else:
|
||||||
else:
|
body = body.decode("utf-8", errors="ignore")
|
||||||
body = body.decode("utf-8")
|
|
||||||
log.debug("Query Docker %s %s params=%s data=%s Response: %s", method, path, params, data, body)
|
log.debug("Query Docker %s %s params=%s data=%s Response: %s", method, path, params, data, body)
|
||||||
return 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})
|
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):
|
async def delete(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user