aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2015-09-18 09:25:39 +0200
committerAdam Stokes <adam.stokes@ubuntu.com>2015-09-29 20:22:45 -0400
commitc607cac7256ced5d1396ae61591f9eae4a9d385f (patch)
tree960e78a047ecc7fd1145294d5b1777563125aae0
parent237d81696eff1a582686c80045e54db5b177d6ab (diff)
downloadsos-c607cac7256ced5d1396ae61591f9eae4a9d385f.tar.gz
[sosreport] fix command-line report defaults
opts.report is True regardless of using --no-report option or not. That means the test "if not self.opts.report:" to decide generation of reports is evaluated to False every time and no report is generated any time. This commit renames opts.report and SoSOptions._report to noreport (to get rid of the variable name confusion) and updates default value accordingly. Resolves #625 Closes #644 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
-rw-r--r--sos/sosreport.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py
index 02d8a328..a1f1b96c 100644
--- a/sos/sosreport.py
+++ b/sos/sosreport.py
@@ -250,7 +250,7 @@ class SoSOptions(object):
_list_profiles = False
_config_file = ""
_tmp_dir = ""
- _report = True
+ _noreport = False
_sysroot = None
_chroot = 'auto'
_compression_type = 'auto'
@@ -522,17 +522,17 @@ class SoSOptions(object):
self._tmp_dir = value
@property
- def report(self):
+ def noreport(self):
if self._options is not None:
- return self._options.report
- return self._report
+ return self._options.noreport
+ return self._noreport
- @report.setter
- def report(self, value):
+ @noreport.setter
+ def noreport(self, value):
self._check_options_initialized()
if not isinstance(value, bool):
- raise TypeError("SoSOptions.report expects a boolean")
- self._report = value
+ raise TypeError("SoSOptions.noreport expects a boolean")
+ self._noreport = value
@property
def sysroot(self):
@@ -646,8 +646,8 @@ class SoSOptions(object):
help="specify alternate temporary directory",
default=None)
parser.add_option("--no-report", action="store_true",
- dest="report",
- help="Disable HTML/XML reporting", default=True)
+ dest="noreport",
+ help="Disable HTML/XML reporting", default=False)
parser.add_option("-s", "--sysroot", action="store", dest="sysroot",
help="system root directory path (default='/')",
default=None)
@@ -1499,7 +1499,7 @@ class SoSReport(object):
self.prework()
self.setup()
self.collect()
- if not self.opts.report:
+ if not self.opts.noreport:
self.report()
self.html_report()
self.plain_report()