Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2016
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. tries = 0
  2. while(True):
  3.     success = true
  4.     try:
  5.         self.client.connect(self.hostname, username=username, password=password, timeout=20)
  6.     except Exception, socket.error:
  7.         success = false
  8.         tries += 1
  9.         log.warning(' {}: no{} "{}'.format(str(socket.error), str(tries), str(self.hostname)))
  10.         if tries >= 2:
  11.             break
  12.     if success
  13.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement