diff options
-rwxr-xr-x | bin/sosreport | 18 | ||||
-rw-r--r-- | sos/__init__.py | 2 | ||||
-rw-r--r-- | sos/component.py | 2 |
3 files changed, 16 insertions, 6 deletions
diff --git a/bin/sosreport b/bin/sosreport index 3c2b5e03..a298d636 100755 --- a/bin/sosreport +++ b/bin/sosreport @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # This file is part of the sos project: https://github.com/sosreport/sos # # This copyrighted material is made available to anyone wishing to use, @@ -11,15 +11,25 @@ import sys import os +import time + try: # allow running from the git checkout, even though as of 4.0 we are moving # binaries into a bin/ top-level directory. - sys.path.append(os.getcwd()) - from sos.report import main + sys.path.insert(0, os.getcwd()) + from sos import SoS except KeyboardInterrupt: raise SystemExit() if __name__ == '__main__': - main(sys.argv[1:]) + msg = ("Please note the 'sosreport' command has been deprecated in favor " + "of the new 'sos' command, E.G. 'sos report'.\n" + "Redirecting to 'sos report %s'" % (' '.join(sys.argv[1:]) or '')) + print(msg) + time.sleep(0.5) + args = sys.argv[1:] + args.insert(0, 'report') + sos = SoS(args) + sos.execute() # vim:ts=4 et sw=4 diff --git a/sos/__init__.py b/sos/__init__.py index 85d59921..da6db6cf 100644 --- a/sos/__init__.py +++ b/sos/__init__.py @@ -74,7 +74,7 @@ class SoS(): _com_subparser.register('action', 'extend', SosListOption) self._add_common_options(_com_subparser) self._components[comp].add_parser_options(parser=_com_subparser) - self.args = self.parser.parse_args() + self.args = self.parser.parse_args(self.cmdline) self._init_component() def _add_common_options(self, parser): diff --git a/sos/component.py b/sos/component.py index 68c58224..b187330b 100644 --- a/sos/component.py +++ b/sos/component.py @@ -124,7 +124,7 @@ class SoSComponent(): option.default = None # load values from cmdline - cmdopts = SoSOptions().from_args(self.parser.parse_args()) + cmdopts = SoSOptions().from_args(self.parser.parse_args(self.cmdline)) opts.merge(cmdopts) # load values from config file |