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
7 changed files with 21 additions and 25 deletions

View File

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

View File

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

View File

@@ -1050,7 +1050,7 @@ class CAInstance(DogtagInstance):
cmonger.stop() cmonger.stop()
# remove CRL files # remove CRL files
logger.info("Remove old CRL files") logger.debug("Remove old CRL files")
try: try:
for f in get_crl_files(): for f in get_crl_files():
logger.debug("Remove %s", f) logger.debug("Remove %s", f)
@@ -1059,7 +1059,7 @@ class CAInstance(DogtagInstance):
logger.warning("Error while removing old CRL files: %s", e) logger.warning("Error while removing old CRL files: %s", e)
# remove CRL directory # remove CRL directory
logger.info("Remove CRL directory") logger.debug("Remove CRL directory")
if os.path.exists(paths.PKI_CA_PUBLISH_DIR): if os.path.exists(paths.PKI_CA_PUBLISH_DIR):
try: try:
shutil.rmtree(paths.PKI_CA_PUBLISH_DIR) shutil.rmtree(paths.PKI_CA_PUBLISH_DIR)
@@ -1271,12 +1271,12 @@ class CAInstance(DogtagInstance):
if sysupgrade.get_upgrade_state('dogtag', 'setup_lwca_key_retrieval'): if sysupgrade.get_upgrade_state('dogtag', 'setup_lwca_key_retrieval'):
return 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_kerberos()
self.__setup_lightweight_ca_key_retrieval_custodia() self.__setup_lightweight_ca_key_retrieval_custodia()
logger.info('Configuring key retriever') logger.debug('Configuring key retriever')
directives = [ directives = [
('features.authority.keyRetrieverClass', ('features.authority.keyRetrieverClass',
'com.netscape.ca.ExternalProcessKeyRetriever'), 'com.netscape.ca.ExternalProcessKeyRetriever'),
@@ -1292,12 +1292,12 @@ class CAInstance(DogtagInstance):
def __setup_lightweight_ca_key_retrieval_kerberos(self): def __setup_lightweight_ca_key_retrieval_kerberos(self):
pent = pwd.getpwnam(self.service_user) pent = pwd.getpwnam(self.service_user)
logger.info('Creating principal') logger.debug('Creating principal')
installutils.kadmin_addprinc(self.principal) installutils.kadmin_addprinc(self.principal)
self.suffix = ipautil.realm_to_suffix(self.realm) self.suffix = ipautil.realm_to_suffix(self.realm)
self.move_service(self.principal) self.move_service(self.principal)
logger.info('Retrieving keytab') logger.debug('Retrieving keytab')
installutils.create_keytab(self.keytab, self.principal) installutils.create_keytab(self.keytab, self.principal)
os.chmod(self.keytab, 0o600) os.chmod(self.keytab, 0o600)
os.chown(self.keytab, pent.pw_uid, pent.pw_gid) 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): def __setup_lightweight_ca_key_retrieval_custodia(self):
pent = pwd.getpwnam(self.service_user) pent = pwd.getpwnam(self.service_user)
logger.info('Creating Custodia keys') logger.debug('Creating Custodia keys')
custodia_basedn = DN( custodia_basedn = DN(
('cn', 'custodia'), ('cn', 'ipa'), ('cn', 'etc'), api.env.basedn) ('cn', 'custodia'), ('cn', 'ipa'), ('cn', 'etc'), api.env.basedn)
ensure_entry( ensure_entry(
@@ -1686,7 +1686,7 @@ def import_included_profiles():
# Create the profile, replacing any existing profile of same name # Create the profile, replacing any existing profile of same name
profile_data = __get_profile_config(profile_id) profile_data = __get_profile_config(profile_id)
_create_dogtag_profile(profile_id, profile_data, overwrite=True) _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 api.Backend.ra_certprofile.override_port = None
conn.disconnect() conn.disconnect()
@@ -1794,8 +1794,8 @@ def _create_dogtag_profile(profile_id, profile_data, overwrite):
# import the profile # import the profile
try: try:
profile_api.create_profile(profile_data) profile_api.create_profile(profile_data)
logger.info("Profile '%s' successfully migrated to LDAP", logger.debug("Profile '%s' successfully migrated to LDAP",
profile_id) profile_id)
except errors.RemoteRetrieveError as e: except errors.RemoteRetrieveError as e:
logger.debug("Error migrating '%s': %s", profile_id, 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. *master_host_name* to create a replica with CA.
""" """
assert isinstance(mode, CustodiaModes) assert isinstance(mode, CustodiaModes)
logger.info( logger.debug(
"Custodia client for '%r' with promotion %s.", "Custodia client for '%r' with promotion %s.",
mode, 'yes' if config.promote else 'no' mode, 'yes' if config.promote else 'no'
) )
@@ -83,7 +83,7 @@ def get_custodia_instance(config, mode):
if custodia_peer is None: if custodia_peer is None:
# use ldapi with local dirsrv instance # use ldapi with local dirsrv instance
logger.info("Custodia uses LDAPI.") logger.debug("Custodia uses LDAPI.")
else: else:
logger.info("Custodia uses '%s' as master peer.", custodia_peer) 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: if not already_enabled:
domain = dnsutil.DNSName(util.normalize_zone(api.env.domain)) domain = dnsutil.DNSName(util.normalize_zone(api.env.domain))
print("Checking DNS domain %s, please wait ..." % domain)
try: try:
dnsutil.check_zone_overlap(domain, raise_on_error=False) dnsutil.check_zone_overlap(domain, raise_on_error=False)
except ValueError as e: except ValueError as e:

View File

@@ -319,9 +319,9 @@ class DogtagInstance(service.Service):
def stop_tracking_certificates(self, stop_certmonger=True): def stop_tracking_certificates(self, stop_certmonger=True):
"""Stop tracking our certificates. Called on uninstall. """Stop tracking our certificates. Called on uninstall.
""" """
self.print_msg( logger.debug(
"Configuring certmonger to stop tracking system certificates " "Configuring certmonger to stop tracking system certificates "
"for %s" % self.subsystem) "for %s", self.subsystem)
cmonger = services.knownservices.certmonger cmonger = services.knownservices.certmonger
services.knownservices.messagebus.start() 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 # chrony will be handled here in uninstall() method as well by invoking
# the ipa-server-install --uninstall # the ipa-server-install --uninstall
if not options.no_ntp: if not options.no_ntp:
print("Synchronizing time") if not ipaclient.install.client.sync_time(options, fstore, sstore):
if ipaclient.install.client.sync_time(options, fstore, sstore):
print("Time synchronization was successful.")
else:
print("Warning: IPA was unable to sync time with chrony!") print("Warning: IPA was unable to sync time with chrony!")
print(" Time synchronization is required for IPA " print(" Time synchronization is required for IPA "
"to work correctly") "to work correctly")