def get_dst_user_from_src_user_id(src_keystone, dst_keystone, src_user_id,
                                  fallback_to_admin=True):
    try:
        with proxy_client.expect_exception(ks_exceptions.NotFound):
            src_user = src_keystone.keystone_client.users.get(src_user_id)
        src_user_name = src_user.name
    except ks_exceptions.NotFound:
        LOG.warning("User '%s' not found on SRC!", src_user_id)
        if fallback_to_admin:
            LOG.warning("Replacing user '%s' with SRC admin", src_user_id)
            src_user_name = cfglib.CONF.src.user
        else:
            return

    if fallback_to_admin:
        default_user_name = cfglib.CONF.dst.user
    else:
        default_user_name = None
    try:
        with proxy_client.expect_exception(ks_exceptions.NotFound):
            return dst_keystone.try_get_user_by_name(
                src_user_name, default_user_name)
    except ks_exceptions.NotFound:
        return None
Join two or more pathname components, inserting slashes as needed.
dataset/ETHPy150Open MirantisWorkloadMobility/CloudFerry/cloudferry/lib/os/identity/keystone.py/get_dst_user_from_src_user_id--crossover with--dataset/ETHPy150Open scrapinghub/splash/splash/utils.py/path_join_secure