diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2011-07-28 10:27:01 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2011-07-28 10:27:27 -0400 |
commit | e2dc5f5a5fbc992c39d36693de552c275fef8f47 (patch) | |
tree | 2a966b46ed9927b817076eb9c524ff7c6ee7a91a /src/lib/Server/Lint | |
parent | e7f6dd5dc96c8d4d8043c148c1a4c6e2b59fa99b (diff) | |
download | bcfg2-e2dc5f5a5fbc992c39d36693de552c275fef8f47.tar.gz bcfg2-e2dc5f5a5fbc992c39d36693de552c275fef8f47.tar.bz2 bcfg2-e2dc5f5a5fbc992c39d36693de552c275fef8f47.zip |
bcfg2-lint RequiredAttrs plugin checks for text content of "file" Paths
Diffstat (limited to 'src/lib/Server/Lint')
-rw-r--r-- | src/lib/Server/Lint/RequiredAttrs.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/Server/Lint/RequiredAttrs.py b/src/lib/Server/Lint/RequiredAttrs.py index cb69149b5..f1a50c13e 100644 --- a/src/lib/Server/Lint/RequiredAttrs.py +++ b/src/lib/Server/Lint/RequiredAttrs.py @@ -61,6 +61,13 @@ class RequiredAttrs(Bcfg2.Server.Lint.ServerPlugin): if dev_type in ['block', 'char']: # check if major/minor are specified required_attrs |= set(['major', 'minor']) + + if pathtype == 'file' and not entry.text: + self.LintError("required-attrs-missing", + "Text missing for %s %s in %s: %s" % + (entry.tag, pathname, filename, + self.RenderXML(entry))) + if not pathset.issuperset(required_attrs): self.LintError("required-attrs-missing", "The required attributes %s are missing for %s %sin %s:\n%s" % |