More errors message on tcpout connection failure on ipv4
authorJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Wed, 29 Feb 2012 14:42:22 +0000 (14:42 +0000)
committerJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Wed, 29 Feb 2012 14:42:22 +0000 (14:42 +0000)
bin/inputs/tcpout.py

index a4ada99122a46a419644471113a0806bcbf15418..124e552f11a187532c86459ed0813252006f2f98 100644 (file)
@@ -35,7 +35,11 @@ class TcpOutChannel(Channel):
         except socket.gaierror, err:
             logging.error("Can't connet to %s: %s using tcp6", address_out, err)
             self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-            self.sock.connect(address_out)
+            try:
+                self.sock.connect(address_out)
+            except socket.error, err:
+                logging.error("Can't connet to %s: %s using tcp4", address_out, err)
+                raise
             logging.info("Connected to %s using tcp4", address_out)
 
     def fill_buffer(self):