diff --git a/src/bindings/python/flux/job/validator/plugins/jobspec.py b/src/bindings/python/flux/job/validator/plugins/jobspec.py index 54e57fd8d19b..7af57667a334 100644 --- a/src/bindings/python/flux/job/validator/plugins/jobspec.py +++ b/src/bindings/python/flux/job/validator/plugins/jobspec.py @@ -17,6 +17,7 @@ import json +from flux.cli.plugin import CLIPluginRegistry from flux.job import validate_jobspec from flux.job.validator import ValidatorPlugin @@ -24,6 +25,7 @@ class Validator(ValidatorPlugin): def __init__(self, parser): self.require_version = 1 + self.plugins = [] parser.add_argument( "--require-version", metavar="V", @@ -47,5 +49,12 @@ def configure(self, args): raise ValueError(f"Invalid argument to --require-version") self.require_version = None + self.plugins = CLIPluginRegistry().load_plugins("validate") + def validate(self, args): - validate_jobspec(json.dumps(args.jobspec), self.require_version) + result, jobspec = validate_jobspec( + json.dumps(args.jobspec), self.require_version + ) + + # validate with any submit cli plugin validate methods + self.plugins.validate(jobspec)