commit 93ddb343c48d7158f34c0e5e8f016b2798a078e8 Author: Bryn M. Reeves Date: Fri Jan 24 15:42:53 2014 +0000 Tidy up formatting of UI preamble text The formatting of the template preamble used a narrow terminal width since there is no native python method for obtaining the actual terminal geometry and the common methods for doing this are non-portable (e.g. Windows specific ioctls or shelling out to stty). This causes the top of the message to scroll off the screen on a standard 80x25 terminal (e.g. putty or a non-resized gnome-terminal or xterm window). Remove the paragraph indentation and increase the assumed width from 58 to 72 chars. This causes the message to fill a standard 80x25 terminal without scrolling. Signed-off-by: Bryn M. Reeves diff --git a/sos/policies/__init__.py b/sos/policies/__init__.py index 47ace5c..c9cfd21 100644 --- a/sos/policies/__init__.py +++ b/sos/policies/__init__.py @@ -115,17 +115,21 @@ class PackageManager(object): class Policy(object): msg = _("""\ -This command will collect system configuration and diagnostic information \ -from this %(distro)s system. An archive containing the collected information \ -will be generated in %(tmpdir)s. +This command will collect diagnostic and configuration \ +information from this %(distro)s system and installed \ +applications. -For more information on %(vendor)s visit: +An archive containing the collected information will be \ +generated in %(tmpdir)s and may be provided to a %(vendor)s \ +support representative. +Any information provided to %(vendor)s will be treated in \ +accordance with the published support policies at:\n %(vendor_url)s -The generated archive may contain data considered sensitive and its content \ -should be reviewed by the originating organization before being passed to \ -any third party. +The generated archive may contain data considered sensitive \ +and its content should be reviewed by the originating \ +organization before being passed to any third party. No changes will be made to system configuration. %(vendor_text)s @@ -296,14 +300,14 @@ No changes will be made to system configuration. the user in non-batch mode. If your policy sets self.distro that text will be substituted accordingly. You can also override this method to do something more complicated.""" - width = 58 + width = 72 _msg = self.msg % {'distro': self.distro, 'vendor': self.vendor, 'vendor_url': self.vendor_url, 'vendor_text': self.vendor_text, 'tmpdir': self.commons['tmpdir']} _fmt = "" for line in _msg.splitlines(): - _fmt = _fmt + fill(" " + line, width, replace_whitespace = False) + '\n' + _fmt = _fmt + fill(line, width, replace_whitespace = False) + '\n' return _fmt diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py index 9321815..5b3a446 100644 --- a/sos/policies/redhat.py +++ b/sos/policies/redhat.py @@ -91,26 +91,6 @@ class RedHatPolicy(LinuxPolicy): return self.host_name() class RHELPolicy(RedHatPolicy): - - msg = _("""\ -This command will collect system configuration and diagnostic information \ -from this %(distro)s system. An archive containing the collected information \ -will be generated in %(tmpdir)s and may be provided to a %(vendor)s support \ -representative or used for local diagnostic or recording purposes. - -Any information provided to %(vendor)s will be treated in strict confidence \ -in accordance with the published support policies at: - - %(vendor_url)s - -The generated archive may contain data considered sensitive and its content \ -should be reviewed by the originating organization before being passed to \ -any third party. - -No changes will be made to system configuration. -%(vendor_text)s -""") - distro = "Red Hat Enterprise Linux" vendor = "Red Hat" vendor_url = "https://access.redhat.com/support/"