Create a syndic, and asynchronously connect it to a master

def _connect_syndic(self, opts):
        '''
        Create a syndic, and asynchronously connect it to a master
        '''
        auth_wait = opts['acceptance_wait_time']
        failed = False
        while True:
            if failed:
                if auth_wait < self.max_auth_wait:
                    auth_wait += self.auth_wait
                log.debug(
                    "sleeping before reconnect attempt to %s [%d/%d]",
                    opts['master'],
                    auth_wait,
                    self.max_auth_wait,
                )
                yield tornado.gen.sleep(auth_wait)  # TODO: log?
            log.debug(
                'Syndic attempting to connect to %s',
                opts['master']
            )
            try:
                syndic = Syndic(opts,
                                timeout=self.SYNDIC_CONNECT_TIMEOUT,
                                safe=False,
                                io_loop=self.io_loop,
                                )
                yield syndic.connect_master(failed=failed)
                # set up the syndic to handle publishes (specifically not event forwarding)
                syndic.tune_in_no_block()

                # Send an event to the master that the minion is live
                syndic.fire_master_syndic_start()

                log.info(
                    'Syndic successfully connected to %s',
                    opts['master']
                )
                break
            except SaltClientError as exc:
                failed = True
                log.error(
                    'Error while bringing up syndic for multi-syndic. Is the '
                    'master at %s responding?', opts['master']
                )
            except (KeyboardInterrupt, SystemExit):
                raise
            except Exception:
                failed = True
                log.critical(
                    'Unexpected error while connecting to %s',
                    opts['master'], exc_info=True
                )

        raise tornado.gen.Return(syndic)