Skip to content

Commit 7ccd6d2

Browse files
committed
wqMerge branch 'development' into alex_nvme
2 parents acc901a + 56e1790 commit 7ccd6d2

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

nodescraper/cli/cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,10 @@ def main(arg_input: Optional[list[str]] = None):
437437

438438
if parsed_args.reference_config:
439439
ref_config = generate_reference_config(results, plugin_reg, logger)
440-
path = os.path.join(os.getcwd(), "reference_config.json")
440+
if log_path:
441+
path = os.path.join(log_path, "reference_config.json")
442+
else:
443+
path = os.path.join(os.getcwd(), "reference_config.json")
441444
try:
442445
with open(path, "w") as f:
443446
json.dump(

nodescraper/pluginexecutor.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,16 +243,26 @@ def apply_global_args_to_plugin(
243243
else:
244244
run_args[key] = global_args[key]
245245

246-
if "collection_args" in global_args and hasattr(plugin_class, "COLLECTOR_ARGS"):
247-
plugin_fields = set(plugin_class.COLLECTOR_ARGS.__fields__.keys())
246+
if (
247+
"collection_args" in global_args
248+
and hasattr(plugin_class, "COLLECTOR_ARGS")
249+
and plugin_class.COLLECTOR_ARGS is not None
250+
):
251+
252+
plugin_fields = set(plugin_class.COLLECTOR_ARGS.model_fields.keys())
248253
filtered = {
249254
k: v for k, v in global_args["collection_args"].items() if k in plugin_fields
250255
}
251256
if filtered:
252257
run_args["collection_args"] = filtered
253258

254-
if "analysis_args" in global_args and hasattr(plugin_class, "ANALYZER_ARGS"):
255-
plugin_fields = set(plugin_class.ANALYZER_ARGS.__fields__.keys())
259+
if (
260+
"analysis_args" in global_args
261+
and hasattr(plugin_class, "ANALYZER_ARGS")
262+
and plugin_class.ANALYZER_ARGS is not None
263+
):
264+
265+
plugin_fields = set(plugin_class.ANALYZER_ARGS.model_fields.keys())
256266
filtered = {k: v for k, v in global_args["analysis_args"].items() if k in plugin_fields}
257267
if filtered:
258268
run_args["analysis_args"] = filtered

0 commit comments

Comments
 (0)