diff --git a/sos/cleaner/__init__.py b/sos/cleaner/__init__.py index b5ea40dad6..fbb7c55e55 100644 --- a/sos/cleaner/__init__.py +++ b/sos/cleaner/__init__.py @@ -19,7 +19,6 @@ from concurrent.futures import ThreadPoolExecutor from datetime import datetime from pwd import getpwuid -from textwrap import fill import sos.cleaner.preppers @@ -177,13 +176,6 @@ def log_info(self, msg, caller=None): def log_error(self, msg, caller=None): self.soslog.error(self._fmt_log_msg(msg, caller)) - def _fmt_msg(self, msg): - width = 80 - _fmt = '' - for line in msg.splitlines(): - _fmt = _fmt + fill(line, width, replace_whitespace=False) + '\n' - return _fmt - @classmethod def display_help(cls, section): section.set_title("SoS Cleaner Detailed Help") diff --git a/sos/collector/__init__.py b/sos/collector/__init__.py index e26f3efd3f..9485f86a06 100644 --- a/sos/collector/__init__.py +++ b/sos/collector/__init__.py @@ -26,7 +26,6 @@ from getpass import getpass from pathlib import Path from shlex import quote -from textwrap import fill from sos.cleaner import SoSCleaner from sos.collector.sosnode import SosNode from sos.options import ClusterOption, str_to_bool @@ -712,13 +711,6 @@ def _get_archive_path(self): compr = 'gz' return self.tmpdir + '/' + self.arc_name + '.tar.' + compr - def _fmt_msg(self, msg): - width = 80 - _fmt = '' - for line in msg.splitlines(): - _fmt = _fmt + fill(line, width, replace_whitespace=False) + '\n' - return _fmt - def _load_group_config(self): """ Attempts to load the host group specified on the command line. diff --git a/sos/component.py b/sos/component.py index 6f42046022..f440a8b21b 100644 --- a/sos/component.py +++ b/sos/component.py @@ -16,6 +16,7 @@ import sys import time +from textwrap import fill from argparse import SUPPRESS from datetime import datetime from getpass import getpass @@ -458,6 +459,13 @@ def _setup_logging(self): def get_temp_file(self): return self.tempfile_util.new() + def _fmt_msg(self, msg): + width = 80 + _fmt = '' + for line in msg.splitlines(): + _fmt = _fmt + fill(line, width, replace_whitespace=False) + '\n' + return _fmt + class SoSMetadata(): """This class is used to record metadata from a sos execution that will diff --git a/sos/upload/__init__.py b/sos/upload/__init__.py index 5b9554e22a..a924463b08 100644 --- a/sos/upload/__init__.py +++ b/sos/upload/__init__.py @@ -10,7 +10,6 @@ import os import sys -from textwrap import fill from sos.component import SoSComponent from sos import _sos as _ from sos import __version__ @@ -89,13 +88,6 @@ def display_help(cls, section): 'to a distribution specific location.' ) - def _fmt_msg(self, msg): - width = 80 - _fmt = '' - for line in msg.splitlines(): - _fmt = _fmt + fill(line, width, replace_whitespace=False) + '\n' - return _fmt - def intro(self): """Print the intro message and prompts for a case ID if one is not provided on the command line