2023-01-09 15:25:16 +00:00
|
|
|
from ansiblelater.standard import StandardBase
|
|
|
|
|
|
|
|
|
|
|
|
class CheckVersion(StandardBase):
|
|
|
|
|
|
|
|
sid = "ANSIBLE9998"
|
|
|
|
description = "Standards version should be pinned"
|
|
|
|
helptext = "Standards version not set. Using latest standards version {version}"
|
2023-01-09 19:41:46 +00:00
|
|
|
types = ["task", "handler", "rolevars", "meta", "template", "file", "playbook"]
|
2023-01-09 15:25:16 +00:00
|
|
|
|
2023-02-10 07:51:17 +00:00
|
|
|
def check(self, candidate, settings): # noqa
|
2023-01-09 15:25:16 +00:00
|
|
|
errors = []
|
|
|
|
|
|
|
|
if not candidate.version_config:
|
|
|
|
errors.append(self.Error(None, self.helptext.format(version=candidate.version)))
|
|
|
|
|
|
|
|
return self.Result(candidate.path, errors)
|