summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorAlexander Bokovoy <abokovoy@redhat.com>2011-10-12 19:14:55 +0300
committerRob Crittenden <rcritten@redhat.com>2011-10-12 19:21:07 -0400
commit7501b17895bc2cb3d25004646164d45686ca7b60 (patch)
treebce4735387e90f764ff276d7bb8a563bf661162d /ipapython
parentc876461e10d57b49b3a692655c449dfbb125af17 (diff)
downloadfreeipa.git-7501b17895bc2cb3d25004646164d45686ca7b60.tar.gz
freeipa.git-7501b17895bc2cb3d25004646164d45686ca7b60.tar.xz
freeipa.git-7501b17895bc2cb3d25004646164d45686ca7b60.zip
Refactor authconfig use in ipa-client-install
When certain features are being configured via authconfig, we need to remember what was configured and what was the state before it so that during uninstall we restore proper state of the services. Mostly it affects sssd configuration with multiple domains but also pre-existing LDAP and krb5 configurations. This should fix following tickets: https://fedorahosted.org/freeipa/ticket/1750 https://fedorahosted.org/freeipa/ticket/1769
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/sysrestore.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/ipapython/sysrestore.py b/ipapython/sysrestore.py
index 9b0e39fc..e22b4d4f 100644
--- a/ipapython/sysrestore.py
+++ b/ipapython/sysrestore.py
@@ -130,6 +130,19 @@ class FileStore:
self.files[filename] = string.join([str(stat.st_mode),str(stat.st_uid),str(stat.st_gid),path], ',')
self.save()
+ def has_file(self, path):
+ """Checks whether file at @path was added to the file store
+
+ Returns #True if the file exists in the file store, #False otherwise
+ """
+ result = False
+ for (key, value) in self.files.items():
+ (mode,uid,gid,filepath) = string.split(value, ',', 3)
+ if (filepath == path):
+ result = True
+ break
+ return result
+
def restore_file(self, path):
"""Restore the copy of a file at @path to its original
location and delete the copy.