def METHOD_NAME(request, module_target_sat, module_capsule_configured):
    if settings.remotedb.server:
        yield Satellite(settings.remotedb.server)
    else:
        module_target_sat.register_to_cdn(pool_ids=settings.subscription.fm_rhn_poolid.split())
        hosts = {'satellite': module_target_sat, 'capsule': module_capsule_configured}
        yield hosts[request.param]