EDIT: aim of this ticket has been changed to remove dependency of ipaplatform from client libraries.
Currently ipaplatform's platform is detected and selected on build time by configure. The script uses /etc/os-release ID field as platform selector and creates symlinks from ipaplatform/$PLATFORM/module.py to ipaplatform/module.py. The approach basically hard-codes a platform on build time.
While the approach is reasonable for distribution packages like RPM, it doesn't work for Python wheels and PyPI packages. In order to make an ipaplatform wheel package usable on another platform (e.g. build on fedora, imported on centos), ipaplatform has to select the platform at runtime.
I propose to parse /etc/os-release at import time and auto-detect the best matching platform based on ID and ID_LIKE.
Related to that, ipaplatform also should become a namespace package. A namespace package allows 3rd parties to add their own platform definition as external packages.
See #6475 for ipaplatform.debian support.
I forgot to explain ID and ID_LIKE. ID_LIKE contains a space separated list of similar distributions. For example CentOS has ID=centos and ID_LIKE="rhel fedora". With my proposal CentOS will automatically use ipaplatform.rhel.
It has been decided that it'd be better to rather strip the critical modules off the ipaplatform dependency: Integration Improvements ML thread. This should be worked in the design page.
Closing per triage from Mon Nov 21.
Different approach was decided.
Platform dependent code will be removed from libraries.
Push failed, reopening.
It was actually pushed, an error in tooling occured
master:
Two relevant files still import ipaplatform:
ipatests/test_ipalib/test_errors.py:from ipaplatform.paths import paths ipatests/test_ipalib/test_config.py:from ipaplatform.paths import paths
The line https://github.com/freeipa/freeipa/blob/master/ipapython/certdb.py#L35 needs a pylint disable comment. The assignment of CERTUTIL, PK12UTIL and OPENSSL should be moved into a else block, too.
https://github.com/freeipa/freeipa/pull/295 addresses comment 12 and 13.
pr 295 pushed. Christian is it all, can the ticket be closed?
Yes, all ok.
Metadata Update from @cheimes: - Issue assigned to someone - Issue set to the milestone: FreeIPA 4.5
ipa-4-8:
Login to comment on this ticket.