Reduce logging verbosity when collecting logs

It's not uncommon that some commands fail when collecting logs.
We already log all failures in utils.execute, no need to duplicate
them with a non-fatal ERROR logging.

Change-Id: If151b3a3be979bd2b3ce01030e5d6242ad74eaa3
(cherry picked from commit 2fcf35e56d)
This commit is contained in:
Dmitry Tantsur 2021-06-11 16:04:59 +02:00 committed by Julia Kreger
parent 8287b96628
commit 76d061ea87
1 changed files with 1 additions and 2 deletions

View File

@ -342,7 +342,6 @@ def get_command_output(command):
except (processutils.ProcessExecutionError, OSError) as e:
error_msg = ('Failed to get the output of the command "%(command)s". '
'Error: %(error)s' % {'command': command, 'error': e})
LOG.error(error_msg)
raise errors.CommandExecutionError(error_msg)
return io.BytesIO(out)
@ -411,7 +410,7 @@ def collect_system_logs(journald_max_lines=None):
try:
io_dict[file_name] = get_command_output(command)
except errors.CommandExecutionError:
pass
LOG.debug('Collecting logs from command %s has failed', command)
io_dict = {}
file_list = []