summaryrefslogtreecommitdiff
path: root/lib/ansible/plugins
diff options
context:
space:
mode:
authorPeter Sprygada <privateip@users.noreply.github.com>2016-12-03 20:05:33 -0500
committerGitHub <noreply@github.com>2016-12-03 20:05:33 -0500
commit8e562018ed0724b918a0e2f25d67e59429056dec (patch)
tree8b6ef56a9cc3cb4f8684cedb561c642c7222daff /lib/ansible/plugins
parentea5c3df04303250e30e11fab437b5499cdab9839 (diff)
downloadansible-8e562018ed0724b918a0e2f25d67e59429056dec.tar.gz
adds py3 compat changes to network_cli plugin (#18735)
now calculates StringIO receive buffer and if received data is less than buffer size, resets offset to 0
Diffstat (limited to 'lib/ansible/plugins')
-rw-r--r--lib/ansible/plugins/connection/network_cli.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ansible/plugins/connection/network_cli.py b/lib/ansible/plugins/connection/network_cli.py
index 34c5029243..403358738e 100644
--- a/lib/ansible/plugins/connection/network_cli.py
+++ b/lib/ansible/plugins/connection/network_cli.py
@@ -116,7 +116,8 @@ class Connection(_Connection):
data = self._shell.recv(256)
recv.write(data)
- recv.seek(recv.tell() - 256)
+ offset = recv.tell() - 256 if recv.tell() > 256 else 0
+ recv.seek(offset)
window = self._strip(recv.read())