mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
client: extract checks from uninstall to uninstall_check
Checks if uninstallation is possible should be moved to uninstall_check https://fedorahosted.org/freeipa/ticket/6392 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
parent
3f690a0a3a
commit
fcea3b3fb8
@ -232,6 +232,10 @@ def main():
|
||||
env={"PATH":"/bin:/sbin:/usr/kerberos/bin:/usr/kerberos/sbin:/usr/bin:/usr/sbin"}
|
||||
|
||||
if options.uninstall:
|
||||
rval_check = client.uninstall_check(options)
|
||||
if rval_check != client.SUCCESS:
|
||||
return rval_check
|
||||
|
||||
return client.uninstall(options, env)
|
||||
|
||||
rval_check = client.install_check(options)
|
||||
|
@ -2867,9 +2867,8 @@ def install(options, env):
|
||||
return SUCCESS
|
||||
|
||||
|
||||
def uninstall(options, env):
|
||||
def uninstall_check(options):
|
||||
fstore = sysrestore.FileStore(paths.IPA_CLIENT_SYSRESTORE)
|
||||
statestore = sysrestore.StateFile(paths.IPA_CLIENT_SYSRESTORE)
|
||||
|
||||
if not is_ipa_client_installed(fstore):
|
||||
root_logger.error("IPA client is not configured on this system.")
|
||||
@ -2882,6 +2881,13 @@ def uninstall(options, env):
|
||||
root_logger.info("Refer to ipa-server-install for uninstallation.")
|
||||
return CLIENT_NOT_CONFIGURED
|
||||
|
||||
return SUCCESS
|
||||
|
||||
|
||||
def uninstall(options, env):
|
||||
fstore = sysrestore.FileStore(paths.IPA_CLIENT_SYSRESTORE)
|
||||
statestore = sysrestore.StateFile(paths.IPA_CLIENT_SYSRESTORE)
|
||||
|
||||
try:
|
||||
run(["ipa-client-automount", "--uninstall", "--debug"])
|
||||
except Exception as e:
|
||||
|
Loading…
Reference in New Issue
Block a user