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
This commit is contained in:
miaohb 2017-11-21 00:33:58 -08:00
parent 5ee3b99161
commit 8a87ea05f4

View File

@ -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