summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorAlexander Bokovoy <abokovoy@redhat.com>2011-10-12 16:42:09 +0300
committerRob Crittenden <rcritten@redhat.com>2011-10-11 18:20:07 -0400
commitb17dfe4a8623e8c3e88c424ddaf7ad664c97898b (patch)
treefa6a4a563e7176d2be8656db6939a88b88a9fb55 /doc
parentc2ae286e4bcaa64d12b3578c434d2f3f0fed95b4 (diff)
downloadfreeipa-b17dfe4a8623e8c3e88c424ddaf7ad664c97898b.tar.gz
freeipa-b17dfe4a8623e8c3e88c424ddaf7ad664c97898b.tar.xz
freeipa-b17dfe4a8623e8c3e88c424ddaf7ad664c97898b.zip
Refactor backup_and_replace_hostname() into a flexible config modification tool
backup_and_replace_hostname() was doing three things: 1. Given config file in 'key=value' style, replace value for a specified key (HOSTNAME) 2. Backup original file and install a replacement 3. Restore original security context after editing We have several more places where parts of the functionality are needed, thus making two tools in ipapython.ipautil: 1. config_replace_variables(filepath, replacevars=dict(), appendvars=dict()) Replaces or appends values to specified keys, adding new key=value pairs if key was absent 2. backup_config_and_replace_variables(fstore, filepath, replacevars=dict(), appendvars=dict()) Backups config file and calls config_replace_variables() A caller must handle security context after using these two tools. In addition, as before, there is ipapython.services.backup_and_replace_hostname() that uses these common tools and restores security context after editing. The code will be used extensively for systemd integration for Fedora 16. Fixes: https://fedorahosted.org/freeipa/ticket/1871
Diffstat (limited to 'doc')
0 files changed, 0 insertions, 0 deletions