def sanitize_db_url(url):
    match = _DBURL_REGEX.match(url)
    if match:
        return '%s****:****%s' % (url[:match.start(1)], url[match.end(2):])
    return url


# copy from glance/db/sqlalchemy/api.py
dataset/ETHPy150Open openstack/oslo.db/oslo_db/sqlalchemy/utils.py/sanitize_db_url/original