'Wait until a conductor service is up and running.
This method calls the remote ping() method on the conductor topic until
it gets a response.  It starts with a shorter timeout in the loop
(early_timeout) up to early_attempts number of tries.  It then drops
back to the globally configured timeout for rpc calls for each retry.'

def wait_until_ready(self, context, early_timeout=10, early_attempts=10):

    attempt = 0
    timeout = early_timeout
    has_timedout = False
    while True:
        if (attempt == early_attempts):
            timeout = None
        attempt += 1
        try:
            self.base_rpcapi.ping(context, '1.21    GigaWatts', timeout=timeout)
            if has_timedout:
                LOG.info('nova-conductor    connection    established    successfully')
            break
        except messaging.MessagingTimeout:
            has_timedout = True
            LOG.warning('Timed    out    waiting    for    nova-conductor.        Is    it    running?    Or    did    this    service    start    before    nova-conductor?        Reattempting    establishment    of    nova-conductor    connection...')
