mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-11 08:41:55 -06:00
Log errors from backup_and_replace hostname to logger
Without logging errors to logger is hard to debug issue from logfile. https://fedorahosted.org/freeipa/ticket/5794 Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
parent
d3ac5125ce
commit
5e10b2eed2
@ -332,8 +332,11 @@ class RedHatTaskNamespace(BaseTaskNamespace):
|
|||||||
try:
|
try:
|
||||||
self.set_hostname(hostname)
|
self.set_hostname(hostname)
|
||||||
except ipautil.CalledProcessError as e:
|
except ipautil.CalledProcessError as e:
|
||||||
print(("Failed to set this machine hostname to "
|
root_logger.debug(traceback.format_exc())
|
||||||
"%s (%s)." % (hostname, str(e))), file=sys.stderr)
|
root_logger.error(
|
||||||
|
"Failed to set this machine hostname to %s (%s).",
|
||||||
|
old_hostname, e
|
||||||
|
)
|
||||||
|
|
||||||
filepath = paths.ETC_HOSTNAME
|
filepath = paths.ETC_HOSTNAME
|
||||||
if os.path.exists(filepath):
|
if os.path.exists(filepath):
|
||||||
|
Loading…
Reference in New Issue
Block a user