Skip to content

Commit

Permalink
Avoid WARN on empty/template meta/main.yaml
Browse files Browse the repository at this point in the history
WARNING  Ignored exception from RoleNames.matchyaml while processing roles/xxx/meta/main.yaml (meta): 'NoneType' object has no attribute 'get'
  • Loading branch information
GElkayam authored and ssbarnea committed Jan 20, 2025
1 parent 9eecae0 commit f974604
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ansiblelint/rules/role_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def matchyaml(self, file: Lintable) -> list[MatchError]:
if file.kind not in ("meta", "role", "playbook"):
return result

if file.kind == "meta":
if file.kind == "meta" and file.data:
for role in file.data.get("dependencies", []):
if isinstance(role, dict):
role_name = role["role"]
Expand Down

0 comments on commit f974604

Please sign in to comment.