mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-23 07:33:27 -06:00
b5c1ce88a4
Currently, FreeIPA's install/admin scripts are long pieces of code that aren't very reusable, importable, or testable. They have been extended over time with features such as logging and error handling, but since each tool was extended individually, there is much inconsistency and code duplication. This patch starts a framework which the admin tools can use, and converts ipa-ldap-updater to use the framework. Common tasks the tools do -- option parsing, validation, logging setup, error handling -- are represented as methods. Individual tools can extend, override or reuse the defaults as they see fit. The ipa-ldap-updater has two modes (normal and --upgrade) that don't share much functionality. They are represented by separate classes. Option parsing, and selecting which class to run, happens before they're instantiated. All code is moved to importable modules to aid future testing. The only thing that remains in the ipa-ldap-updater script is a two-line call to the library. First part of the work for: https://fedorahosted.org/freeipa/ticket/2652 |
||
---|---|---|
.. | ||
platform | ||
py_default_encoding | ||
test | ||
__init__.py | ||
admintool.py | ||
certdb.py | ||
certmonger.py | ||
compat.py | ||
config.py | ||
dogtag.py | ||
entity.py | ||
ipa_log_manager.py | ||
ipa.conf | ||
ipautil.py | ||
ipavalidate.py | ||
kernel_keyring.py | ||
log_manager.py | ||
Makefile | ||
MANIFEST.in | ||
nsslib.py | ||
README | ||
services.py.in | ||
setup.py.in | ||
sysrestore.py | ||
version.py.in |
This is a set of libraries common to IPA clients and servers though mostly geared currently towards command-line tools. A brief overview: config.py - identify the IPA server domain and realm. It uses python-dns to try to detect this information first and will fall back to /etc/ipa/default.conf if that fails. ipautil.py - helper functions entity.py - entity is the main data type. User and Group extend this class (but don't add anything currently). ipavalidate.py - basic data validation routines