diff options
author | Martin Basti <mbasti@redhat.com> | 2015-02-09 16:18:28 +0100 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2015-02-18 10:05:45 +0100 |
commit | b5e06b90c9113836eef5b04f0993097314d2be84 (patch) | |
tree | b6351b948559bc0e183805e128625f71a673bff1 | |
parent | f499e506c86d076a57e74bcca587394c8036ed57 (diff) | |
download | freeipa-b5e06b90c9113836eef5b04f0993097314d2be84.tar.gz freeipa-b5e06b90c9113836eef5b04f0993097314d2be84.tar.xz freeipa-b5e06b90c9113836eef5b04f0993097314d2be84.zip |
Uninstall configured services only
Fixes:
dnskeysyncisntance - requires a stored state to be uninstalled
bindinstance - uninstal service only if bind was configured by IPA
Ticket:https://fedorahosted.org/freeipa/ticket/4869
Reviewed-By: David Kupka <dkupka@redhat.com>
-rwxr-xr-x | install/tools/ipa-server-install | 10 | ||||
-rw-r--r-- | ipaserver/install/dnskeysyncinstance.py | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install index 8b2b8a3c2..56a43770d 100755 --- a/install/tools/ipa-server-install +++ b/install/tools/ipa-server-install @@ -597,8 +597,14 @@ def uninstall(): if ods_exporter.is_configured(): ods_exporter.uninstall() - bindinstance.BindInstance(fstore).uninstall() - dnskeysyncinstance.DNSKeySyncInstance(fstore).uninstall() + bind = bindinstance.BindInstance(fstore) + if bind.is_configured(): + bind.uninstall() + + dnskeysync = dnskeysyncinstance.DNSKeySyncInstance(fstore) + if dnskeysync.is_configured(): + dnskeysync.uninstall() + httpinstance.HTTPInstance(fstore).uninstall() krbinstance.KrbInstance(fstore).uninstall() dsinstance.DsInstance(fstore=fstore).uninstall() diff --git a/ipaserver/install/dnskeysyncinstance.py b/ipaserver/install/dnskeysyncinstance.py index 1396d01a7..090c87505 100644 --- a/ipaserver/install/dnskeysyncinstance.py +++ b/ipaserver/install/dnskeysyncinstance.py @@ -179,6 +179,9 @@ class DNSKeySyncInstance(service.Service): ): raise RuntimeError("DNS container does not exist") + # ready to be installed, storing a state is required to run uninstall + self.backup_state("configured", True) + def __setup_dnssec_containers(self): """ Setup LDAP containers for DNSSEC @@ -472,14 +475,13 @@ class DNSKeySyncInstance(service.Service): def uninstall(self): - if not self.is_configured(): - return - - self.print_msg("Unconfiguring %s" % self.service_name) + if self.is_configured(): + self.print_msg("Unconfiguring %s" % self.service_name) # Just eat states self.restore_state("running") self.restore_state("enabled") + self.restore_state("configured") # stop and disable service (IPA service, we do not need it anymore) self.stop() |