lib/marionette/master.rb in marionette-0.0.10 vs lib/marionette/master.rb in marionette-0.0.11
- old
+ new
@@ -18,32 +18,36 @@
# Sends a msg to puppet node
# and stands by for a reply
# and processes reply
def talk(msg, send_guarantee = false, poll_guarantee = false)
- # Initial connection to socket
- @socket = socket_connect
- @poll = true
-
# Initiate send
begin
# if send successful start polling
+ @socket = socket_connect
@socket.send_string Marshal.dump(msg), ZMQ::NOBLOCK
+ @poll = true
rescue
+ puts "*****RESCUE******"
+
if send_guarantee
# Keep sending till successful
while true do
begin
+ @socket = socket_connect
@socket.send_string Marshal.dump(msg), ZMQ::NOBLOCK
+ @poll = true
break
rescue
+
+ puts "*****inner RESCUE******"
# sleep half a second before next attempt
sleep 500
end