code: def _waitForSSHPort(self):
          
          logger.debug('Waiting for ssh port to open...')
          for i in count():
              s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
              try:
                  s.settimeout(a_short_time)
                  s.connect((self.effectiveIP, 22))
                  logger.debug('...ssh port open')
                  return i
              except socket.error:
                  pass
              finally:
                  s.close()
docs: Wait until the instance represented by this box is accessible via SSH.
  
          :return: the number of unsuccessful attempts to connect to the port before a the first
          success