Skip to content

Commit 4161949

Browse files
committed
Return only stdout and stderr channels in read_all
Adapt docstring to new behavior and remove ref to channel id being part of the return value.
1 parent 07f91db commit 4161949

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

kubernetes/client/ws_client.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ def readline_stderr(self, timeout=None):
135135
return self.readline_channel(STDERR_CHANNEL, timeout=timeout)
136136

137137
def read_all(self):
138-
"""Read all of the inputs with the same order they recieved. The channel
139-
information would be part of the string. This is useful for
140-
non-interactive call where a set of command passed to the API call and
141-
their result is needed after the call is concluded.
138+
"""Return buffered data received on stdout and stderr channels.
139+
This is useful for non-interactive call where a set of command passed
140+
to the API call and their result is needed after the call is concluded.
141+
Should be called after run_forever() or update()
142142
143143
TODO: Maybe we can process this and return a more meaningful map with
144144
channels mapped for each input.
@@ -178,9 +178,10 @@ def update(self, timeout=0):
178178
channel = ord(data[0])
179179
data = data[1:]
180180
if data:
181-
# keeping all messages in the order they received for
182-
# non-blocking call.
183-
self._all += data
181+
if channel in [STDOUT_CHANNEL, STDERR_CHANNEL]:
182+
# keeping all messages in the order they received for
183+
# non-blocking call.
184+
self._all += data
184185
if channel not in self._channels:
185186
self._channels[channel] = data
186187
else:

0 commit comments

Comments
 (0)