Skip to content

Commit d3e790d

Browse files
committed
Add new option to run all applicable plugins
Introducing a new option -a (--all) that will allow user to run all applicable plugins regardless whether a plugin is optional or not. Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
1 parent f142977 commit d3e790d

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

servicereportpkg/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ def parse_commandline_args(args):
3232
parser = ArgumentParser(description="Validation tool to \
3333
verify the system configurations")
3434

35+
parser.add_argument("-a", "--all", action="store_true",
36+
dest="all", default=False,
37+
help="Execute all plugins applicable to the system")
38+
3539
parser.add_argument("-d", "--dump", action="store_true",
3640
dest="dump", default=False,
3741
help="Trigger a dump")
@@ -73,6 +77,12 @@ def parse_commandline_args(args):
7377
if parsed_argument.plugins and parsed_argument.optional:
7478
parser.error("-o(--optional) is not allowed with -p(--pluigns)\n"
7579
"\t\t\tList all the plugins against -p option only.")
80+
81+
if parsed_argument.all and (parsed_argument.plugins or
82+
parsed_argument.optional):
83+
parser.error("-a(--all) option is not allowd with -p(--plugins)\n"
84+
"\t\t\tor -o(--optional) option.")
85+
7686
return parser.parse_args(args)
7787

7888

servicereportpkg/validate/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ def is_plugin_executable(self, plugin_name, plugin_obj):
4747
"""Check whether the give plugin is executable in current system
4848
environment"""
4949

50+
if self.cmd_opts.all:
51+
return True
52+
5053
if self.cmd_opts.plugins:
5154
return plugin_name in self.cmd_opts.plugins
5255

0 commit comments

Comments
 (0)