fix(validation): refuse a specs argument that is not a list
This commit is contained in:
@@ -117,7 +117,10 @@ class ActionModule(ActionBase):
|
||||
paths = []
|
||||
# A pattern (`.../*/roles/*/meta/argument_specs.yml`) picks up every role's spec without a list
|
||||
# to keep in sync; one that matches nothing is a broken path, not an empty set.
|
||||
for entry in self._task.args["specs"]:
|
||||
specs = self._task.args["specs"]
|
||||
if not isinstance(specs, list):
|
||||
raise AnsibleError(f"specs must be a list of spec file paths, got {type(specs).__name__}")
|
||||
for entry in specs:
|
||||
matches = sorted(glob.glob(entry)) if glob.has_magic(entry) else [entry]
|
||||
if not matches:
|
||||
raise AnsibleError(f"no spec file matches {entry}")
|
||||
|
||||
Reference in New Issue
Block a user