#9438 Allow applications to override cache directory
Closed: fixed by frenaud. Opened by cheimes.

Request for enhancement

As an author of a custom IPA-based service written in Python, I want be able to override the default cache directory for schema cache, server info, and KRA keys. FreeIPA's default cache directory is ~/.cache/ipa. The home directory of a service account may be missing or not writable by the service. While it is possible to set a custom cache directory with XDG_CACHE_HOME, it's awkward to set from a service. The value of the env var is cached on import time. The env var must be set before any IPA Python code is imported.

Proposal: Support api.bootstrap(cache_dir="/path/to/custom/cache")


Metadata Update from @cheimes:
- Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/6983
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1513934

master:

  • 5deeee31c0ebbbf15642a928d9c30e42150bbfc2 Add 'cache_dir' option to api.env

@cheimes can you add a documentation text in the "changelog" field of this pagure ticket? This text will be automatically added to the release notes when we cut an official release with this patch. Thanks.

ipa-4-11:

  • f476d86ee4a50752b29b3940eec76ffc478d6563 Add 'cache_dir' option to api.env

ipa-4-10:

  • 20e59b014086dc93a0235a931d46b6c09a802f03 Add 'cache_dir' option to api.env

Metadata Update from @frenaud:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Metadata