From eb80bd1a56635233cfbe4e547de222f20bbe13c0 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Mon, 14 Jul 2014 14:14:13 -0500 Subject: [PATCH] Break out of loop for sockets in wait_for when there's no data to read --- library/utilities/wait_for | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/utilities/wait_for b/library/utilities/wait_for index e8788cb7a7d..e87fd566a4c 100644 --- a/library/utilities/wait_for +++ b/library/utilities/wait_for @@ -213,7 +213,9 @@ def main(): matched = False while 1: data += s.recv(1024) - if re.search(search_regex, data, re.MULTILINE): + if not data: + break + elif re.search(search_regex, data, re.MULTILINE): matched = True break if matched: