def db_setup_with_retry(db_name, db_host, db_port, username=None, password=None, ensure_indexes=True, ssl=False, ssl_keyfile=None, ssl_certfile=None, ssl_cert_reqs=None, ssl_ca_certs=None, ssl_match_hostname=True):
 retrying_obj = retrying.Retrying(retry_on_exception=_retry_if_connection_error, wait_exponential_multiplier=(cfg.CONF.database.connection_retry_backoff_mul * 1000), wait_exponential_max=(cfg.CONF.database.connection_retry_backoff_max_s * 1000), stop_max_delay=((cfg.CONF.database.connection_retry_max_delay_m * 60) * 1000))
 return retrying_obj.call(db_setup, db_name, db_host, db_port, username=username, password=password, ensure_indexes=ensure_indexes, ssl=ssl, ssl_keyfile=ssl_keyfile, ssl_certfile=ssl_certfile, ssl_cert_reqs=ssl_cert_reqs, ssl_ca_certs=ssl_ca_certs, ssl_match_hostname=ssl_match_hostname)

def db_setup_with_retry ( db_name , db_host , db_port , username = None , password = None , ensure_indexes = True , ssl = False , ssl_keyfile = None , ssl_certfile = None , ssl_cert_reqs = None , ssl_ca_certs = None , ssl_match_hostname = True ) : retrying_obj = retrying . Retrying ( retry_on_exception = _retry_if_connection_error , wait_exponential_multiplier = ( cfg . CONF . database . connection_retry_backoff_mul * 1000 ) , wait_exponential_max = ( cfg . CONF . database . connection_retry_backoff_max_s * 1000 ) , stop_max_delay = ( ( cfg . CONF . database . connection_retry_max_delay_m * 60 ) * 1000 ) ) return retrying_obj . call ( db_setup , db_name , db_host , db_port , username = username , password = password , ensure_indexes = ensure_indexes , ssl = ssl , ssl_keyfile = ssl_keyfile , ssl_certfile = ssl_certfile , ssl_cert_reqs = ssl_cert_reqs , ssl_ca_certs = ssl_ca_certs , ssl_match_hostname = ssl_match_hostname )
this method is a retry version of db_setup .