diff options
author | Martin Basti <mbasti@redhat.com> | 2016-10-26 15:01:38 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2016-11-11 12:13:56 +0100 |
commit | 33537f555636db935dd809b62498e2415d765e8e (patch) | |
tree | 30581a0fecefc7ce0c502b04654e4d1785cb7a50 /client | |
parent | 19912796edf5d6427920ff67c33e6288223e0466 (diff) | |
download | freeipa-33537f555636db935dd809b62498e2415d765e8e.tar.gz freeipa-33537f555636db935dd809b62498e2415d765e8e.tar.xz freeipa-33537f555636db935dd809b62498e2415d765e8e.zip |
client: make statestore and fstore consistent with server
There should not be mixed statestore as global variable and as local
function parameter. This commit fixes usage of sysrestore and statestore
as local variables only. In future we may need to change default
statestore and fstore depending on where the functions are called and
this change makes it easier and less error prone.
https://fedorahosted.org/freeipa/ticket/6392
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Diffstat (limited to 'client')
-rwxr-xr-x | client/ipa-client-install | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/client/ipa-client-install b/client/ipa-client-install index a30fee8b9..7959bac22 100755 --- a/client/ipa-client-install +++ b/client/ipa-client-install @@ -37,10 +37,6 @@ from ipalib import x509 from ipalib.util import normalize_hostname, validate_domain_name -fstore = sysrestore.FileStore(paths.IPA_CLIENT_SYSRESTORE) -statestore = sysrestore.StateFile(paths.IPA_CLIENT_SYSRESTORE) - - def parse_options(): def validate_ca_cert_file_option(option, opt, value, parser): if not os.path.exists(value): @@ -227,6 +223,7 @@ def logging_setup(options): def main(): + fstore = sysrestore.FileStore(paths.IPA_CLIENT_SYSRESTORE) safe_options, options = parse_options() if not os.getegid() == 0: @@ -246,14 +243,14 @@ def main(): if options.uninstall: return client.uninstall(options, env) - if client.is_ipa_client_installed(on_master=options.on_master): + if client.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.CLIENT_ALREADY_CONFIGURED - rval = client.install(options, env, fstore, statestore) + rval = client.install(options, env) if rval == client.CLIENT_INSTALL_ERROR: if options.force: root_logger.warning( |