freeipa/ipaclient/install/ipa_client_install.py
Rob Crittenden b96906156b
Improve console logging for ipa-server-install
The server installation and uninstallation overlaps both the
server and client installers. The output could be confusing
with a server uninstall finishing with the message:

The ipa-client-install command was successful

This was in part due to the fact that the server was not
configured with a console format and verbose was False which
meant that no logger messages were displayed at all.

In order to suppress client installation errors and avoid
confusion add a list of errors to ignore. If a server install
was not successful and hadn't gotten far enough to do the
client install then we shouldn't complain loudly about it.

https://pagure.io/freeipa/issue/6760

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
2018-06-20 08:38:03 +02:00

71 lines
1.7 KiB
Python

#
# Copyright (C) 2016 FreeIPA Contributors see COPYING for license
#
from __future__ import absolute_import
from ipaclient.install import client
from ipaplatform.paths import paths
from ipapython.install import cli
from ipapython.install.core import knob, extend_knob
class StandaloneClientInstall(client.ClientInstall):
no_host_dns = False
no_wait_for_dns = False
principal = client.ClientInstall.principal
principal = extend_knob(
principal,
cli_names=list(principal.cli_names) + ['-p'],
)
password = knob(
str, None,
sensitive=True,
description="password to join the IPA realm (assumes bulk password "
"unless principal is also set)",
cli_names=[None, '-w'],
)
@property
def admin_password(self):
if self.principal:
return self.password
return super(StandaloneClientInstall, self).admin_password
@property
def host_password(self):
if not self.principal:
return self.password
return super(StandaloneClientInstall, self).host_password
prompt_password = knob(
None,
description="Prompt for a password to join the IPA realm",
cli_names='-W',
)
on_master = knob(
None,
deprecated=True,
)
ClientInstall = cli.install_tool(
StandaloneClientInstall,
command_name='ipa-client-install',
log_file_name=paths.IPACLIENT_INSTALL_LOG,
debug_option=True,
verbose=True,
console_format='%(message)s',
uninstall_log_file_name=paths.IPACLIENT_UNINSTALL_LOG,
ignore_return_codes=(client.CLIENT_NOT_CONFIGURED,),
)
def run():
ClientInstall.run_cli()