def _check_not_over_max_retries(self, attempted_hosts):
    if (CONF.migrate_max_retries == (- 1)):
        return
    retries = (len(attempted_hosts) - 1)
    if (retries > CONF.migrate_max_retries):
        msg = (_('Exceeded max scheduling retries %(max_retries)d for instance %(instance_uuid)s during live migration') % {'max_retries': retries, 'instance_uuid': self.instance.uuid})
        raise exception.NoValidHost(reason=msg)
def _check_not_over_max_retries(self, attempted_hosts):
    if (CONF.migrate_max_retries == (- 1)):
        return
    retries = (len(attempted_hosts) - 1)
    if (retries > CONF.migrate_max_retries):
        msg = (_('Exceeded max scheduling retries %(max_retries)d for instance %(instance_uuid)s during live migration') % {'max_retries': retries, 'instance_uuid': self.instance.uuid})
        raise exception.NoValidHost(reason=msg)