diff options
author | Martin Basti <mbasti@redhat.com> | 2016-04-19 18:47:25 +0200 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-04-26 14:01:42 +0200 |
commit | 5e10b2eed29f845e079288c4aa9c8f59967d6dcc (patch) | |
tree | 4731afbe0276c3206a62073c451c38745fd51e18 /ipaplatform | |
parent | d3ac5125ce2b22cf87dbcd98a6eaf71e0f288440 (diff) | |
download | freeipa-5e10b2eed29f845e079288c4aa9c8f59967d6dcc.tar.gz freeipa-5e10b2eed29f845e079288c4aa9c8f59967d6dcc.tar.xz freeipa-5e10b2eed29f845e079288c4aa9c8f59967d6dcc.zip |
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>
Diffstat (limited to 'ipaplatform')
-rw-r--r-- | ipaplatform/redhat/tasks.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ipaplatform/redhat/tasks.py b/ipaplatform/redhat/tasks.py index bc7a9e389..ace29bd1c 100644 --- a/ipaplatform/redhat/tasks.py +++ b/ipaplatform/redhat/tasks.py @@ -332,8 +332,11 @@ class RedHatTaskNamespace(BaseTaskNamespace): try: self.set_hostname(hostname) except ipautil.CalledProcessError as e: - print(("Failed to set this machine hostname to " - "%s (%s)." % (hostname, str(e))), file=sys.stderr) + root_logger.debug(traceback.format_exc()) + root_logger.error( + "Failed to set this machine hostname to %s (%s).", + old_hostname, e + ) filepath = paths.ETC_HOSTNAME if os.path.exists(filepath): |