summaryrefslogtreecommitdiffstats
path: root/ipapython/sysrestore.py
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:20:09 -0400
commit8baec8d06b51717e9835b90deef7e2b47a01d6e3 (patch)
tree55fa2503d98049196707dcab691755159f37ef15 /ipapython/sysrestore.py
parentf7a9da8b3fb7da7a479e54ba4932fd07775d9a4e (diff)
downloadfreeipa-8baec8d06b51717e9835b90deef7e2b47a01d6e3.tar.gz
freeipa-8baec8d06b51717e9835b90deef7e2b47a01d6e3.tar.xz
freeipa-8baec8d06b51717e9835b90deef7e2b47a01d6e3.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/sysrestore.py')
-rw-r--r--ipapython/sysrestore.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/ipapython/sysrestore.py b/ipapython/sysrestore.py
index 9b0e39fcb..e22b4d4fa 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.