adtrustinstance: make sure to stop and disable winbind in uninstall()

Reviewed-By: Martin Kosek <mkosek@redhat.com>
This commit is contained in:
Alexander Bokovoy 2014-02-25 20:11:50 +02:00 committed by Martin Kosek
parent 3a7ba6013f
commit e99fa380af

View File

@ -889,12 +889,15 @@ class ADTRUSTInstance(service.Service):
self.restore_state("running")
self.restore_state("enabled")
winbind = ipaservices.service("winbind")
# Always try to stop and disable smb service, since we do not leave
# working configuration after uninstall
try:
self.stop()
self.disable()
except:
winbind.stop()
winbind.disable()
except Exception:
pass
# Since we do not guarantee restoring back to working samba state,
@ -907,7 +910,7 @@ class ADTRUSTInstance(service.Service):
try:
ipautil.run(["/usr/sbin/setsebool",
"-P", var, sebool_state])
except:
except Exception:
self.print_msg(SELINUX_WARNING % dict(var=var))
# Remove samba's credentials cache