From 874c0f6eec6a93c03816a4a18d5a5a21efaa4ae0 Mon Sep 17 00:00:00 2001 From: Thomas S Hatch Date: Tue, 17 Jun 2014 16:22:10 -0600 Subject: [PATCH] Fix the channel to fail after the timeout and tries --- salt/transport/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/salt/transport/__init__.py b/salt/transport/__init__.py index 75002809fa..df35487242 100644 --- a/salt/transport/__init__.py +++ b/salt/transport/__init__.py @@ -93,12 +93,19 @@ class RAETChannel(Channel): ''' msg = {'route': self.route, 'load': load} self.stack.transmit(msg, self.stack.uids['yard0']) + tried = 1 + start = time.time() while True: time.sleep(0.01) self.stack.serviceAll() if self.stack.rxMsgs: for msg in self.stack.rxMsgs: return msg.get('return', {}) + if time.time() - start > timeout: + if tried >= tries: + raise ValueError + self.stack.transmit(msg, self.stack.uids['yard0']) + tried += 1 class ZeroMQChannel(Channel):