summaryrefslogtreecommitdiffstats
path: root/ipa-client/ipa-install/ipa-client-install
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2015-06-30 15:55:40 +0200
committerTomas Babej <tbabej@redhat.com>2015-07-07 16:27:24 +0200
commit6fa123447f8acfbbdb442a1cbac38997a8e81208 (patch)
treeff1e701495760d7349c1b4be8210e9ea8bfb8b06 /ipa-client/ipa-install/ipa-client-install
parent12b053df300cb58aad157797f4e30283e45033f5 (diff)
downloadfreeipa-6fa123447f8acfbbdb442a1cbac38997a8e81208.tar.gz
freeipa-6fa123447f8acfbbdb442a1cbac38997a8e81208.tar.xz
freeipa-6fa123447f8acfbbdb442a1cbac38997a8e81208.zip
FIX: Clear SSSD caches when uninstalling the client
https://fedorahosted.org/freeipa/ticket/5049 Reviewed-By: Simo Sorce <ssorce@redhat.com>
Diffstat (limited to 'ipa-client/ipa-install/ipa-client-install')
-rwxr-xr-xipa-client/ipa-install/ipa-client-install19
1 files changed, 12 insertions, 7 deletions
diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install
index 8bc3fbe9a..a1564583c 100755
--- a/ipa-client/ipa-install/ipa-client-install
+++ b/ipa-client/ipa-install/ipa-client-install
@@ -479,6 +479,7 @@ def uninstall(options, env):
statestore._load()
hostname = None
+ ipa_domain = None
was_sssd_configured = False
try:
sssdconfig = SSSDConfig.SSSDConfig()
@@ -503,6 +504,10 @@ def uninstall(options, env):
hostname = domain.get_option('ipa_hostname')
except SSSDConfig.NoOptionError:
continue
+ try:
+ ipa_domain = domain.get_option('ipa_domain')
+ except SSSDConfig.NoOptionError:
+ pass
except Exception, e:
# We were unable to read existing SSSD config. This might mean few things:
# - sssd wasn't installed
@@ -632,14 +637,14 @@ def uninstall(options, env):
remove_file(paths.SSSD_MC_GROUP)
remove_file(paths.SSSD_MC_PASSWD)
- ipa_domain = domain.get_option('ipa_domain')
- sssd_domain_ldb = "cache_" + ipa_domain + ".ldb"
- sssd_ldb_file = os.path.join(paths.SSSD_DB, sssd_domain_ldb)
- remove_file(sssd_ldb_file)
+ if ipa_domain:
+ sssd_domain_ldb = "cache_" + ipa_domain + ".ldb"
+ sssd_ldb_file = os.path.join(paths.SSSD_DB, sssd_domain_ldb)
+ remove_file(sssd_ldb_file)
- sssd_domain_ccache = "ccache_" + ipa_domain.upper()
- sssd_ccache_file = os.path.join(paths.SSSD_DB, sssd_domain_ccache)
- remove_file(sssd_domain_ccache)
+ sssd_domain_ccache = "ccache_" + ipa_domain.upper()
+ sssd_ccache_file = os.path.join(paths.SSSD_DB, sssd_domain_ccache)
+ remove_file(sssd_ccache_file)
# Next if-elif-elif construction deals with sssd.conf file.
# Old pre-IPA domains are preserved due merging the old sssd.conf