From 47ebe2e6ddb0bef570496c1565457142fd776f9b Mon Sep 17 00:00:00 2001 From: Victor Zemtsov Date: Fri, 10 Feb 2023 00:55:32 +0300 Subject: [PATCH] Fix #46 custom_properties - long chain are truncated --- plugins/lookup/keepass.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/lookup/keepass.py b/plugins/lookup/keepass.py index c721e72..cdd689a 100644 --- a/plugins/lookup/keepass.py +++ b/plugins/lookup/keepass.py @@ -164,7 +164,14 @@ def _send(self, kp_soc, cmd, terms): display.vvv("KeePass: %s %s" % (cmd, terms)) sock.send(_rq(cmd, *terms)) - resp = sock.recv(1024).decode().splitlines() + data = b'' + while True: + _ = sock.recv(1024) + data += _ + if len(_) < 1024: + break + + resp = data.decode().splitlines() resp_len = len(resp) if resp_len == 0: raise AnsibleError("KeePass: '%s' result is empty" % cmd)