mirror of
https://github.com/thegeeklab/ansible-later.git
synced 2024-11-22 12:50:42 +00:00
fix: ensure galaxy_info is top-level key in meta file
This commit is contained in:
parent
e90b80f12f
commit
4278df2848
@ -16,8 +16,12 @@ class CheckMetaMain(StandardBase):
|
|||||||
keys = ["author", "description", "min_ansible_version", "platforms", "dependencies"]
|
keys = ["author", "description", "min_ansible_version", "platforms", "dependencies"]
|
||||||
|
|
||||||
if not errors:
|
if not errors:
|
||||||
|
has_galaxy_info = (isinstance(content, dict) and "galaxy_info" in content.keys())
|
||||||
|
if not has_galaxy_info:
|
||||||
|
errors.append(self.Error(None, self.helptext.format(key="galaxy_info")))
|
||||||
|
|
||||||
for key in keys:
|
for key in keys:
|
||||||
if not nested_lookup(key, content):
|
if has_galaxy_info and not nested_lookup(key, content.get("galaxy_info", {})):
|
||||||
errors.append(self.Error(None, self.helptext.format(key=key)))
|
errors.append(self.Error(None, self.helptext.format(key=key)))
|
||||||
|
|
||||||
return self.Result(candidate.path, errors)
|
return self.Result(candidate.path, errors)
|
||||||
|
Loading…
Reference in New Issue
Block a user