From 8e562018ed0724b918a0e2f25d67e59429056dec Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Sat, 3 Dec 2016 20:05:33 -0500 Subject: [PATCH] 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 --- lib/ansible/plugins/connection/network_cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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())