URL:
https://github.com/freeipa/freeipa/pull/3036
Author: t-woerner
Title: #3036: New logger.info_cmd used as a replacement of print calls
Action: opened
PR body:
"""
The use of print calls in the installer parts are resulting in the need to
redirect stdout using redirect_stdout in ansible-freeipa. resirect_stdout
is creating a new scope.
The logger has been extended with the info_cmd method. This method is a
wrapper for the info method and is additionally setting { "cmd_output":
True } for the extra argument. This will be filtered with the a
InfoCommandFilter for the log file handler created in
standard_logging_setup.
The log format used for info_cmd is defined with LOGGING_FORMAT_INFO_CMD
and is applied with the extended Formatter class for the log level INFO
only.
These files have been adapted to use logger.info_cmd and logging.getLogger
has been added where it was missing:
ipaclient/install/client.py
ipalib/cli.py
ipalib/messages.py
ipaserver/dnssec/ldapkeydb.py
ipaserver/dnssec/localhsm.py
ipaserver/install/adtrust.py
ipaserver/install/adtrustinstance.py
ipaserver/install/bindinstance.py
ipaserver/install/ca.py
ipaserver/install/cainstance.py
ipaserver/install/custodiainstance.py
ipaserver/install/dns.py
ipaserver/install/dnskeysyncinstance.py
ipaserver/install/dsinstance.py
ipaserver/install/installutils.py
ipaserver/install/ipa_crlgen_manage.py
ipaserver/install/replication.py
ipaserver/install/server/__init__.py
ipaserver/install/server/install.py
ipaserver/install/server/replicainstall.py
ipaserver/install/server/upgrade.py
"""
To pull the PR as Git branch:
git remote add ghfreeipa
https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/3036/head:pr3036
git checkout pr3036