summaryrefslogtreecommitdiffstats
path: root/ipaclient/install/client.py
diff options
context:
space:
mode:
authorStanislav Laznicka <slaznick@redhat.com>2016-10-26 15:04:30 +0200
committerJan Cholasta <jcholast@redhat.com>2016-11-11 12:13:56 +0100
commitbddd4fac462c07458297d1cea5272bde97fb3707 (patch)
tree7b366c0f386a388998b82b4e8feb7d36ca21734e /ipaclient/install/client.py
parentcf1c4e84e74ea15fe5cf7219872cf131bd53281e (diff)
downloadfreeipa-bddd4fac462c07458297d1cea5272bde97fb3707.tar.gz
freeipa-bddd4fac462c07458297d1cea5272bde97fb3707.tar.xz
freeipa-bddd4fac462c07458297d1cea5272bde97fb3707.zip
Replaced EMPTY_LINE constant with a function call
https://fedorahosted.org/freeipa/ticket/6392 Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipaclient/install/client.py')
-rw-r--r--ipaclient/install/client.py43
1 files changed, 21 insertions, 22 deletions
diff --git a/ipaclient/install/client.py b/ipaclient/install/client.py
index fdec1f453..20ea06b25 100644
--- a/ipaclient/install/client.py
+++ b/ipaclient/install/client.py
@@ -300,7 +300,7 @@ def configure_nsswitch_database(fstore, database, services, preserve=True,
# Set new services as sources for database
opts = [
conf.setOption(database, new_value),
- IPAChangeConf.EMPTY_LINE,
+ conf.emptyLine(),
]
conf.changeConf(paths.NSSWITCH_CONF, opts)
@@ -319,7 +319,7 @@ def configure_ipa_conf(
'type': 'comment',
'value': 'File modified by ipa-client-install'
},
- IPAChangeConf.EMPTY_LINE,
+ ipaconf.emptyLine(),
]
# [global]
@@ -337,7 +337,7 @@ def configure_ipa_conf(
opts.extend([
ipaconf.setSection('global', defopts),
- IPAChangeConf.EMPTY_LINE,
+ ipaconf.emptyLine(),
])
target_fname = paths.IPA_DEFAULT_CONF
@@ -371,11 +371,11 @@ def configure_ldap_conf(
'type': 'comment',
'value': 'File modified by ipa-client-install'
},
- IPAChangeConf.EMPTY_LINE,
+ ldapconf.emptyLine(),
ldapconf.setOption('ldap_version', '3'),
ldapconf.setOption('base', cli_basedn),
- IPAChangeConf.EMPTY_LINE,
+ ldapconf.emptyLine(),
ldapconf.setOption(
'nss_base_passwd', '{dn}{suffix}'
@@ -388,13 +388,13 @@ def configure_ldap_conf(
ldapconf.setOption('nss_schema', 'rfc2307bis'),
ldapconf.setOption('nss_map_attribute', 'uniqueMember member'),
ldapconf.setOption('nss_initgroups_ignoreusers', 'root,dirsrv'),
- IPAChangeConf.EMPTY_LINE,
+ ldapconf.emptyLine(),
ldapconf.setOption('nss_reconnect_maxsleeptime', '8'),
ldapconf.setOption('nss_reconnect_sleeptime', '1'),
ldapconf.setOption('bind_timelimit', '5'),
ldapconf.setOption('timelimit', '15'),
- IPAChangeConf.EMPTY_LINE,
+ ldapconf.emptyLine(),
]
if not dnsok or options.force or options.on_master:
if options.on_master:
@@ -405,7 +405,7 @@ def configure_ldap_conf(
else:
opts.append(ldapconf.setOption('nss_srv_domain', cli_domain))
- opts.append(IPAChangeConf.EMPTY_LINE)
+ opts.append(ldapconf.emptyLine())
# Depending on the release and distribution this may exist in any
# number of different file names, update what we find
@@ -435,18 +435,18 @@ def configure_nslcd_conf(
'type': 'comment',
'value': 'File modified by ipa-client-install'
},
- IPAChangeConf.EMPTY_LINE,
+ nslcdconf.emptyLine(),
nslcdconf.setOption('ldap_version', '3'),
nslcdconf.setOption('base', cli_basedn),
- IPAChangeConf.EMPTY_LINE,
+ nslcdconf.emptyLine(),
nslcdconf.setOption('base passwd', str(
DN(('cn', 'users'), ('cn', 'accounts'), cli_basedn))),
nslcdconf.setOption('base group', str(
DN(('cn', 'groups'), ('cn', 'accounts'), cli_basedn))),
nslcdconf.setOption('timelimit', '15'),
- IPAChangeConf.EMPTY_LINE,
+ nslcdconf.emptyLine(),
]
if not dnsok or options.force or options.on_master:
@@ -458,7 +458,7 @@ def configure_nslcd_conf(
else:
opts.append(nslcdconf.setOption('uri', 'DNS'))
- opts.append(IPAChangeConf.EMPTY_LINE)
+ opts.append(nslcdconf.emptyLine())
for filename in files:
try:
@@ -500,7 +500,7 @@ def configure_openldap_conf(fstore, cli_basedn, cli_server):
'type': 'comment',
'value': ' File modified by ipa-client-install'
},
- IPAChangeConf.EMPTY_LINE,
+ ldapconf.emptyLine(),
{
'name': 'comment',
'type': 'comment',
@@ -542,8 +542,8 @@ def configure_openldap_conf(fstore, cli_basedn, cli_server):
'type': 'comment',
'value': ' corresponding lines generated by IPA.'
},
- IPAChangeConf.EMPTY_LINE,
- IPAChangeConf.EMPTY_LINE,
+ ldapconf.emptyLine(),
+ ldapconf.emptyLine(),
{
'action': 'addifnotset',
'name': 'URI',
@@ -601,7 +601,7 @@ def hardcode_ldap_server(cli_server):
opts = [
ldapconf.setOption('uri', 'ldap://{}'.format(
ipautil.format_netloc(cli_server[0]))),
- IPAChangeConf.EMPTY_LINE,
+ ldapconf.emptyLine(),
]
# Errors raised by this should be caught by the caller
@@ -627,7 +627,7 @@ def configure_krb5_conf(
'type': 'comment',
'value': 'File modified by ipa-client-install'
},
- IPAChangeConf.EMPTY_LINE,
+ krbconf.emptyLine(),
{
'name': 'includedir',
'type': 'option',
@@ -645,8 +645,7 @@ def configure_krb5_conf(
'value': paths.SSSD_PUBCONF_KRB5_INCLUDE_D_DIR,
'delim': ' '
},
- IPAChangeConf.EMPTY_LINE
- ])
+ krbconf.emptyLine()])
# [libdefaults]
libopts = [
@@ -677,7 +676,7 @@ def configure_krb5_conf(
opts.extend([
krbconf.setSection('libdefaults', libopts),
- IPAChangeConf.EMPTY_LINE
+ krbconf.emptyLine()
])
# the following are necessary only if DNS discovery does not work
@@ -704,7 +703,7 @@ def configure_krb5_conf(
}]
opts.append(krbconf.setSection('realms', ropts))
- opts.append(IPAChangeConf.EMPTY_LINE)
+ opts.append(krbconf.emptyLine())
# [domain_realm]
dropts = [
@@ -722,7 +721,7 @@ def configure_krb5_conf(
opts.extend([
krbconf.setSection('domain_realm', dropts),
- IPAChangeConf.EMPTY_LINE
+ krbconf.emptyLine()
])
root_logger.debug("Writing Kerberos configuration to %s:", filename)