aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2018-05-26 16:51:03 +0100
committerBryn M. Reeves <bmr@redhat.com>2018-06-20 18:01:21 +0100
commita07fd4f5cb374d88fb1093200020cf8e45ccd916 (patch)
tree3250cf6ec9cebb2c09133b31e2caafef294161c8
parent38e5309f0b61977bc89320a0b6088ea2eea1650f (diff)
downloadsos-a07fd4f5cb374d88fb1093200020cf8e45ccd916.tar.gz
[sosreport] apply preset defaults to command arguments
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/sosreport.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py
index 21884ace..b08baf77 100644
--- a/sos/sosreport.py
+++ b/sos/sosreport.py
@@ -323,6 +323,7 @@ class SoSReport(object):
self.sysroot = "/"
self.sys_tmp = None
self.exit_process = False
+ self.preset = None
try:
import signal
@@ -342,6 +343,9 @@ class SoSReport(object):
self._is_root = self.policy.is_root()
+ self.preset = self.policy.find_preset(cmd_args.preset)
+ self.opts.merge(self.preset.opts)
+
# system temporary directory to use
tmp = os.path.abspath(self.policy.get_tmp_dir(self.opts.tmp_dir))
@@ -888,8 +892,19 @@ class SoSReport(object):
self._exit(1)
def setup(self):
+ # Log command line options
msg = "[%s:%s] executing 'sosreport %s'"
self.soslog.info(msg % (__name__, "setup", " ".join(self._args)))
+
+ # Log active preset defaults
+ msg = ("[%s:%s] using '%s' preset defaults" %
+ (__name__, "setup", self.preset.name))
+ self.soslog.info(msg)
+
+ # Log effective options after applying preset defaults
+ self.soslog.info("[%s:%s] effective options now: %s" %
+ (__name__, "steup", str(self.opts)))
+
self.ui_log.info(_(" Setting up plugins ..."))
for plugname, plug in self.loaded_plugins:
try: