server upgrade: uninstall ipa_memcached properly

Make sure ipa_memcached is not running and no stale state is left in the
sysupgrade state file on server upgrade.

https://fedorahosted.org/freeipa/ticket/5959

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
Jan Cholasta 2017-02-20 08:24:47 +01:00
parent 0862e32091
commit 6d34c2169f

View File

@ -79,14 +79,12 @@ def uninstall_ipa_memcached():
We can't use the full service uninstaller because that will attempt
to stop and disable the service which by now doesn't exist. We just
want to clean up sysrestore.state to remove all references to
ipa_kpasswd.
ipa_memcached.
"""
ipa_memcached = service.SimpleServiceInstance('ipa_memcached')
enabled = not ipa_memcached.restore_state("enabled")
ipa_memcached.uninstall()
if enabled is not None and not enabled:
ipa_memcached.remove()
def backup_file(filename, ext):
"""Make a backup of filename using ext as the extension. Do not overwrite