Commit d7e912bc authored by Marco Mariani's avatar Marco Mariani

minor cleanup

parent 55802c22
# vim: set et sts=2:
############################################################################## ##############################################################################
# #
# Copyright (c) 2011 Vifib SARL and Contributors. All Rights Reserved. # Copyright (c) 2011 Vifib SARL and Contributors. All Rights Reserved.
......
...@@ -7,15 +7,10 @@ import sys ...@@ -7,15 +7,10 @@ import sys
hostname = "%(hostname)s" hostname = "%(hostname)s"
port = %(port)s port = %(port)s
connection_okay = False
try: try:
s = socket.create_connection((hostname, port)) s = socket.create_connection((hostname, port))
connection_okay = True
s.close() s.close()
except (socket.error, socket.timeout): except (socket.error, socket.timeout):
connection_okay = False sys.stderr.write("%(port)s on %(hostname)s isn't listening\n")
if not connection_okay:
print >> sys.stderr, "%(port)s on %(hostname)s isn't listening"
sys.exit(127) sys.exit(127)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment