server install: drop some print statements, change log level

The server installer had no console logger set so print
statements were used for communication. Now that a logger
is enabled the extra prints need to be dropped.

A number of logger.info statements have been upgraded
to debug since they do not need to appear on the console
by default.

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>
This commit is contained in:
Rob Crittenden 2018-05-02 11:43:09 -04:00 committed by Tibor Dudlák
parent 8ea227451f
commit 00ddb5dd53
No known key found for this signature in database
GPG Key ID: 12B8BD343576CDF5
7 changed files with 21 additions and 25 deletions

View File

@ -888,7 +888,7 @@ def configure_sssd_conf(
logger.info(
"The old /etc/sssd/sssd.conf is backed up and "
"will be restored during uninstall.")
logger.info("New SSSD config will be created")
logger.debug("New SSSD config will be created")
sssdconfig = SSSDConfig.SSSDConfig()
sssdconfig.new_config()
@ -2521,8 +2521,8 @@ def _install(options):
elif options.on_master:
# If we're on master skipping the time sync here because it was done
# in ipa-server-install
logger.info("Skipping attempt to configure and synchronize time with"
" chrony server as it has been already done on master.")
logger.debug("Skipping attempt to configure and synchronize time with"
" chrony server as it has been already done on master.")
else:
logger.info("Skipping chrony configuration")

View File

@ -1046,7 +1046,7 @@ class RPCClient(Connectible):
transport_class = LanguageAwareTransport
proxy_kw['transport'] = transport_class(
protocol=self.protocol, service='HTTP', ccache=ccache)
logger.info('trying %s', url)
logger.debug('trying %s', url)
setattr(context, 'request_url', url)
serverproxy = self.server_proxy_class(url, **proxy_kw)
if len(urls) == 1:
@ -1136,8 +1136,8 @@ class RPCClient(Connectible):
# each time should we be getting UNAUTHORIZED error from the server
max_tries = 5
for try_num in range(0, max_tries):
logger.info("[try %d]: Forwarding '%s' to %s server '%s'",
try_num+1, name, self.protocol, server)
logger.debug("[try %d]: Forwarding '%s' to %s server '%s'",
try_num + 1, name, self.protocol, server)
try:
return self._call_command(command, params)
except Fault as e:

View File

@ -1050,7 +1050,7 @@ class CAInstance(DogtagInstance):
cmonger.stop()
# remove CRL files
logger.info("Remove old CRL files")
logger.debug("Remove old CRL files")
try:
for f in get_crl_files():
logger.debug("Remove %s", f)
@ -1059,7 +1059,7 @@ class CAInstance(DogtagInstance):
logger.warning("Error while removing old CRL files: %s", e)
# remove CRL directory
logger.info("Remove CRL directory")
logger.debug("Remove CRL directory")
if os.path.exists(paths.PKI_CA_PUBLISH_DIR):
try:
shutil.rmtree(paths.PKI_CA_PUBLISH_DIR)
@ -1271,12 +1271,12 @@ class CAInstance(DogtagInstance):
if sysupgrade.get_upgrade_state('dogtag', 'setup_lwca_key_retrieval'):
return
logger.info('[Set up lightweight CA key retrieval]')
logger.debug('Set up lightweight CA key retrieval')
self.__setup_lightweight_ca_key_retrieval_kerberos()
self.__setup_lightweight_ca_key_retrieval_custodia()
logger.info('Configuring key retriever')
logger.debug('Configuring key retriever')
directives = [
('features.authority.keyRetrieverClass',
'com.netscape.ca.ExternalProcessKeyRetriever'),
@ -1292,12 +1292,12 @@ class CAInstance(DogtagInstance):
def __setup_lightweight_ca_key_retrieval_kerberos(self):
pent = pwd.getpwnam(self.service_user)
logger.info('Creating principal')
logger.debug('Creating principal')
installutils.kadmin_addprinc(self.principal)
self.suffix = ipautil.realm_to_suffix(self.realm)
self.move_service(self.principal)
logger.info('Retrieving keytab')
logger.debug('Retrieving keytab')
installutils.create_keytab(self.keytab, self.principal)
os.chmod(self.keytab, 0o600)
os.chown(self.keytab, pent.pw_uid, pent.pw_gid)
@ -1305,7 +1305,7 @@ class CAInstance(DogtagInstance):
def __setup_lightweight_ca_key_retrieval_custodia(self):
pent = pwd.getpwnam(self.service_user)
logger.info('Creating Custodia keys')
logger.debug('Creating Custodia keys')
custodia_basedn = DN(
('cn', 'custodia'), ('cn', 'ipa'), ('cn', 'etc'), api.env.basedn)
ensure_entry(
@ -1686,7 +1686,7 @@ def import_included_profiles():
# Create the profile, replacing any existing profile of same name
profile_data = __get_profile_config(profile_id)
_create_dogtag_profile(profile_id, profile_data, overwrite=True)
logger.info("Imported profile '%s'", profile_id)
logger.debug("Imported profile '%s'", profile_id)
api.Backend.ra_certprofile.override_port = None
conn.disconnect()
@ -1794,8 +1794,8 @@ def _create_dogtag_profile(profile_id, profile_data, overwrite):
# import the profile
try:
profile_api.create_profile(profile_data)
logger.info("Profile '%s' successfully migrated to LDAP",
profile_id)
logger.debug("Profile '%s' successfully migrated to LDAP",
profile_id)
except errors.RemoteRetrieveError as e:
logger.debug("Error migrating '%s': %s", profile_id, e)

View File

@ -63,7 +63,7 @@ def get_custodia_instance(config, mode):
*master_host_name* to create a replica with CA.
"""
assert isinstance(mode, CustodiaModes)
logger.info(
logger.debug(
"Custodia client for '%r' with promotion %s.",
mode, 'yes' if config.promote else 'no'
)
@ -83,7 +83,7 @@ def get_custodia_instance(config, mode):
if custodia_peer is None:
# use ldapi with local dirsrv instance
logger.info("Custodia uses LDAPI.")
logger.debug("Custodia uses LDAPI.")
else:
logger.info("Custodia uses '%s' as master peer.", custodia_peer)

View File

@ -127,7 +127,6 @@ def install_check(standalone, api, replica, options, hostname):
if not already_enabled:
domain = dnsutil.DNSName(util.normalize_zone(api.env.domain))
print("Checking DNS domain %s, please wait ..." % domain)
try:
dnsutil.check_zone_overlap(domain, raise_on_error=False)
except ValueError as e:

View File

@ -319,9 +319,9 @@ class DogtagInstance(service.Service):
def stop_tracking_certificates(self, stop_certmonger=True):
"""Stop tracking our certificates. Called on uninstall.
"""
self.print_msg(
logger.debug(
"Configuring certmonger to stop tracking system certificates "
"for %s" % self.subsystem)
"for %s", self.subsystem)
cmonger = services.knownservices.certmonger
services.knownservices.messagebus.start()

View File

@ -770,10 +770,7 @@ def install(installer):
# chrony will be handled here in uninstall() method as well by invoking
# the ipa-server-install --uninstall
if not options.no_ntp:
print("Synchronizing time")
if ipaclient.install.client.sync_time(options, fstore, sstore):
print("Time synchronization was successful.")
else:
if not ipaclient.install.client.sync_time(options, fstore, sstore):
print("Warning: IPA was unable to sync time with chrony!")
print(" Time synchronization is required for IPA "
"to work correctly")