From 1c9267803c6f41cc7d7485024f8864fbd62c9128 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Nov 11 2016 11:13:56 +0000 Subject: client: import IPAChangeConf directly instead the module We should use as specific import as possible, better for python memory consumption and speed, and looks better in code. https://fedorahosted.org/freeipa/ticket/6392 Reviewed-By: Stanislav Laznicka --- diff --git a/ipaclient/install/client.py b/ipaclient/install/client.py index 326008a..36280df 100644 --- a/ipaclient/install/client.py +++ b/ipaclient/install/client.py @@ -32,9 +32,9 @@ from six.moves.urllib.parse import urlparse, urlunparse from ipaclient import ( ipadiscovery, - ipachangeconf, ntpconf, ) +from ipaclient.ipachangeconf import IPAChangeConf from ipalib import ( api, certstore, @@ -265,7 +265,7 @@ def configure_nsswitch_database(fstore, database, services, preserve=True, if not fstore.has_file(paths.NSSWITCH_CONF): fstore.backup_file(paths.NSSWITCH_CONF) - conf = ipachangeconf.IPAChangeConf("IPA Installer") + conf = IPAChangeConf("IPA Installer") conf.setOptionAssignment(':') if preserve: @@ -317,7 +317,7 @@ def configure_nsswitch_database(fstore, database, services, preserve=True, def configure_ipa_conf( fstore, cli_basedn, cli_realm, cli_domain, cli_server, hostname): - ipaconf = ipachangeconf.IPAChangeConf("IPA Installer") + ipaconf = IPAChangeConf("IPA Installer") ipaconf.setOptionAssignment(" = ") ipaconf.setSectionNameDelimiters(("[", "]")) @@ -407,7 +407,7 @@ def disable_ra(): def configure_ldap_conf( fstore, cli_basedn, cli_realm, cli_domain, cli_server, dnsok, options, files): - ldapconf = ipachangeconf.IPAChangeConf("IPA Installer") + ldapconf = IPAChangeConf("IPA Installer") ldapconf.setOptionAssignment(" ") opts = [ @@ -537,7 +537,7 @@ def configure_ldap_conf( def configure_nslcd_conf( fstore, cli_basedn, cli_realm, cli_domain, cli_server, dnsok, options, files): - nslcdconf = ipachangeconf.IPAChangeConf("IPA Installer") + nslcdconf = IPAChangeConf("IPA Installer") nslcdconf.setOptionAssignment(" ") opts = [ @@ -644,7 +644,7 @@ def configure_nslcd_conf( def configure_openldap_conf(fstore, cli_basedn, cli_server): - ldapconf = ipachangeconf.IPAChangeConf("IPA Installer") + ldapconf = IPAChangeConf("IPA Installer") ldapconf.setOptionAssignment((" ", "\t")) opts = [ @@ -757,7 +757,7 @@ def hardcode_ldap_server(cli_server): if not file_exists(paths.LDAP_CONF): return - ldapconf = ipachangeconf.IPAChangeConf("IPA Installer") + ldapconf = IPAChangeConf("IPA Installer") ldapconf.setOptionAssignment(" ") opts = [ @@ -784,7 +784,7 @@ def configure_krb5_conf( cli_realm, cli_domain, cli_server, cli_kdc, dnsok, options, filename, client_domain, client_hostname): - krbconf = ipachangeconf.IPAChangeConf("IPA Installer") + krbconf = IPAChangeConf("IPA Installer") krbconf.setOptionAssignment((" = ", " ")) krbconf.setSectionNameDelimiters(("[", "]")) krbconf.setSubSectionDelimiters(("{", "}"))