Merge branch 'master' of github.com:kubernetes-incubator/client-python into release-1.0

This commit is contained in:
mbohlool 2017-03-01 13:39:06 -08:00
commit 1f4a93c754
4 changed files with 19 additions and 3 deletions

View File

@ -1,3 +1,7 @@
# v1.0.0
- Bugfix: blocking exec call should remove channel metadata #140
- Add close method to websocket api of interactive exec #145
# v1.0.0b3
- Bugfix: Missing websocket-client dependency #131

View File

@ -16,8 +16,9 @@ should be on the same branch. To update an existing branch:
```bash
export RELEASE_BRANCH=release-x.x
git checkout RELEASE_BRANCH
git checkout $RELEASE_BRANCH
git fetch upstream
git rebase upstream/$RELEASE_BRANCH
git pull upstream master
```
@ -64,7 +65,7 @@ and commit changes (should be only version number changes) to the release branch
Name the commit something like "Update version constants for XXX release".
```bash
git push upstream RELEASE_BRANCH
git push upstream $RELEASE_BRANCH
```
## Make distribution packages

View File

@ -92,3 +92,4 @@ print("Server date command returns: %s" % sdate)
resp.write_stdin("whoami\n")
user = resp.readline_stdout(timeout=3)
print("Server user is: %s" % user)
resp.close()

View File

@ -168,11 +168,13 @@ class WSClient:
data = frame.data
if six.PY3:
data = data.decode("utf-8")
self._all += data
if len(data) > 1:
channel = ord(data[0])
data = data[1:]
if data:
# keeping all messages in the order they received for
# non-blocking call.
self._all += data
if channel not in self._channels:
self._channels[channel] = data
else:
@ -189,6 +191,14 @@ class WSClient:
while self.is_open():
self.update(timeout=None)
def close(self, **kwargs):
"""
close websocket connection.
"""
self._connected = False
if self.sock:
self.sock.close(**kwargs)
WSResponse = collections.namedtuple('WSResponse', ['data'])