aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2018-06-20 10:24:41 -0400
committerBryn M. Reeves <bmr@redhat.com>2018-06-20 16:29:36 +0100
commit9ab8d1cca73b57e027a7edb0d95bf5f00a8a7e80 (patch)
treeed0402b700e36ba89c5852435fd61a776bf404f1
parentd8b6793fd81cf4b7391f038d40616494ff10f624 (diff)
downloadsos-9ab8d1cca73b57e027a7edb0d95bf5f00a8a7e80.tar.gz
[sosreport] Correct verbosity level when -v is not specified
Fixes an issue where verbosity would be set to 'None' rather than 0 in the event that a sosreport was run with options, when those options did not include -v at all. This meant that if any options were specified, a newline would be printed for each started plugin when instead we should still have been refreshing a single line. Related to this, the previous newline behavior was beneficial when running with --batch, so that behavior is maintained if --batch is specified. Resolves: #1355 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/sosreport.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py
index 3e1e3ebe..9d8f693a 100644
--- a/sos/sosreport.py
+++ b/sos/sosreport.py
@@ -605,7 +605,7 @@ class SoSOptions(object):
dest="build", default=False,
help="preserve the temporary directory and do not "
"package results")
- parser.add_argument("-v", "--verbose", action="count",
+ parser.add_argument("-v", "--verbose", action="count", default=0,
dest="verbosity", help="increase verbosity")
parser.add_argument("--verify", action="store_true",
dest="verify", default=False,
@@ -1358,7 +1358,7 @@ class SoSReport(object):
self.handle_exception(plugname, "collect")
def ui_progress(self, status_line):
- if self.opts.verbosity == 0:
+ if self.opts.verbosity == 0 and not self.opts.batch:
status_line = "\r%s" % status_line.ljust(90)
else:
status_line = "%s\n" % status_line