From 8a87ea05f449f6260c7d6dcee73e4ea228f1e717 Mon Sep 17 00:00:00 2001 From: miaohb Date: Tue, 21 Nov 2017 00:33:58 -0800 Subject: [PATCH] Revise the implementation in container exec_resize This patch revises the client to be robust to handle exception from server when doing exec_resize, and make the outcome to be similar as docker. Change-Id: Idcef0b7a368db34df3fcd03ef83c1d5bd45aadb7 Closes-Bug: #1732498 --- zunclient/common/websocketclient/websocketclient.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zunclient/common/websocketclient/websocketclient.py b/zunclient/common/websocketclient/websocketclient.py index 57ef3971..5ad6d595 100644 --- a/zunclient/common/websocketclient/websocketclient.py +++ b/zunclient/common/websocketclient/websocketclient.py @@ -33,6 +33,7 @@ import websocket import docker +from zunclient.common.apiclient import exceptions as acexceptions from zunclient.common.websocketclient import exceptions LOG = logging.getLogger(__name__) @@ -198,6 +199,8 @@ class BaseClient(object): self.tty_resize(height=rows, width=cols) except IOError: # Container already exited pass + except acexceptions.BadRequest: + pass def tty_size(self, fd): """Get the tty size