client: remove unneded return configure_krb5_conf

Function configure_krb5_conf always returns 0 as return state. Remove
the 'return' statement and let exceptions work

https://fedorahosted.org/freeipa/ticket/6392

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
Martin Basti 2016-10-19 16:35:54 +02:00 committed by Jan Cholasta
parent f98faec478
commit 5c16608a0d

View File

@ -1015,8 +1015,6 @@ def configure_krb5_conf(
krbconf.newConf(filename, opts)
os.chmod(filename, 0o644)
return 0
def configure_certmonger(
fstore, subject_base, cli_realm, hostname, options, ca_enabled):
@ -2580,18 +2578,16 @@ def install(options, env, fstore, statestore):
try:
(krb_fd, krb_name) = tempfile.mkstemp()
os.close(krb_fd)
if configure_krb5_conf(
cli_realm=cli_realm,
cli_domain=cli_domain,
cli_server=cli_server,
cli_kdc=cli_kdc,
dnsok=False,
options=options,
filename=krb_name,
client_domain=client_domain,
client_hostname=hostname):
root_logger.error("Test kerberos configuration failed")
return CLIENT_INSTALL_ERROR
configure_krb5_conf(
cli_realm=cli_realm,
cli_domain=cli_domain,
cli_server=cli_server,
cli_kdc=cli_kdc,
dnsok=False,
options=options,
filename=krb_name,
client_domain=client_domain,
client_hostname=hostname)
env['KRB5_CONFIG'] = krb_name
ccache_dir = tempfile.mkdtemp(prefix='krbcc')
ccache_name = os.path.join(ccache_dir, 'ccache')
@ -2791,17 +2787,16 @@ def install(options, env, fstore, statestore):
else:
# Configure krb5.conf
fstore.backup_file(paths.KRB5_CONF)
if configure_krb5_conf(
cli_realm=cli_realm,
cli_domain=cli_domain,
cli_server=cli_server,
cli_kdc=cli_kdc,
dnsok=dnsok,
options=options,
filename=paths.KRB5_CONF,
client_domain=client_domain,
client_hostname=hostname):
return CLIENT_INSTALL_ERROR
configure_krb5_conf(
cli_realm=cli_realm,
cli_domain=cli_domain,
cli_server=cli_server,
cli_kdc=cli_kdc,
dnsok=dnsok,
options=options,
filename=paths.KRB5_CONF,
client_domain=client_domain,
client_hostname=hostname)
root_logger.info(
"Configured /etc/krb5.conf for IPA realm %s", cli_realm)