Revision 25ba209e
b/lib/netutils.py | ||
---|---|---|
281 | 281 |
than C{EADDRNOTAVAIL} will be ignored |
282 | 282 |
|
283 | 283 |
""" |
284 |
logging.debug("Attempting to reach TCP port %s on target %s with a timeout" |
|
285 |
" of %s seconds", port, target, timeout) |
|
286 |
|
|
284 | 287 |
try: |
285 | 288 |
family = IPAddress.GetAddressFamily(target) |
286 |
except errors.GenericError: |
|
287 |
return False |
|
289 |
except errors.IPAddressError, err: |
|
290 |
raise errors.ProgrammerError("Family of IP address given in parameter" |
|
291 |
" 'target' can't be determined: %s" % err) |
|
288 | 292 |
|
289 | 293 |
sock = socket.socket(family, socket.SOCK_STREAM) |
290 | 294 |
success = False |
Also available in: Unified diff