diff options
author | Martin Basti <mbasti@redhat.com> | 2016-10-27 18:50:29 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2016-11-11 12:13:56 +0100 |
commit | 2c226ebc27e2a4e2677549003c4c70a777794296 (patch) | |
tree | fb3e4e420a180b86938375b607a1a87d15f580ce /ipaclient | |
parent | 33537f555636db935dd809b62498e2415d765e8e (diff) | |
download | freeipa-2c226ebc27e2a4e2677549003c4c70a777794296.tar.gz freeipa-2c226ebc27e2a4e2677549003c4c70a777794296.tar.xz freeipa-2c226ebc27e2a4e2677549003c4c70a777794296.zip |
client: move checks to client.install_check
Move checks from ipa-client-install to clien.install_check
https://fedorahosted.org/freeipa/ticket/6392
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Diffstat (limited to 'ipaclient')
-rw-r--r-- | ipaclient/install/client.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/ipaclient/install/client.py b/ipaclient/install/client.py index cf41c068a..cdc9264f6 100644 --- a/ipaclient/install/client.py +++ b/ipaclient/install/client.py @@ -65,13 +65,13 @@ from ipapython.ipautil import ( CalledProcessError, dir_exists, file_exists, + is_fips_enabled, realm_to_suffix, run, user_input, ) from ipapython.ssh import SSHPublicKey - SUCCESS = 0 CLIENT_INSTALL_ERROR = 1 CLIENT_NOT_CONFIGURED = 2 @@ -1918,6 +1918,25 @@ def purge_host_keytab(realm): realm, paths.KRB5_KEYTAB) +def install_check(options): + fstore = sysrestore.FileStore(paths.IPA_CLIENT_SYSRESTORE) + if not os.getegid() == 0: + sys.exit("\nYou must be root to run ipa-client-install.\n") + + if is_fips_enabled(): + sys.exit("Installing IPA client in FIPS mode is not supported") + + tasks.check_selinux_status() + + if is_ipa_client_installed(fstore, on_master=options.on_master): + root_logger.error("IPA client is already configured on this system.") + root_logger.info( + "If you want to reinstall the IPA client, uninstall it first " + + "using 'ipa-client-install --uninstall'.") + return CLIENT_ALREADY_CONFIGURED + return SUCCESS + + def install(options, env): fstore = sysrestore.FileStore(paths.IPA_CLIENT_SYSRESTORE) statestore = sysrestore.StateFile(paths.IPA_CLIENT_SYSRESTORE) |