Skip to content

Commit 704fc4b

Browse files
committed
updated with cmd line arg so you can skip-sudo with plugin_config + cmd line arg
1 parent 79d478c commit 704fc4b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

nodescraper/cli/cli.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@ def build_parser(
154154
help="Generate reference config from system. Writes to ./reference_config.json.",
155155
)
156156

157+
parser.add_argument(
158+
"--skip-sudo",
159+
dest="skip_sudo",
160+
action="store_true",
161+
help="Skip plugins that require sudo permissions",
162+
)
163+
157164
subparsers = parser.add_subparsers(dest="subcmd", help="Subcommands")
158165

159166
summary_parser = subparsers.add_parser(
@@ -418,6 +425,10 @@ def main(arg_input: Optional[list[str]] = None):
418425
plugin_subparser_map=plugin_subparser_map,
419426
)
420427

428+
if parsed_args.skip_sudo:
429+
for pcfg in plugin_config_inst_list:
430+
pcfg.global_args.setdefault("collection_args", {})["skip_sudo"] = True
431+
421432
log_system_info(log_path, system_info, logger)
422433
except Exception as e:
423434
parser.error(str(e))

0 commit comments

Comments
 (0)