diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2014-02-23 23:53:04 -0500 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2014-02-26 22:31:17 -0500 |
commit | 1d7c5d59aa34380e3f9cb43d75bb1fa8220583fc (patch) | |
tree | ab0f76d6aeaa19d6f388a3856aea91b2e20d1a6b /src/lib/Bcfg2/Server | |
parent | d4566b5285bb87cbc3e1a69d091f5404b5acfc0d (diff) | |
download | bcfg2-1d7c5d59aa34380e3f9cb43d75bb1fa8220583fc.tar.gz bcfg2-1d7c5d59aa34380e3f9cb43d75bb1fa8220583fc.tar.bz2 bcfg2-1d7c5d59aa34380e3f9cb43d75bb1fa8220583fc.zip |
bcfg2-lint: verify Path tags in RequiredAttrs
Diffstat (limited to 'src/lib/Bcfg2/Server')
-rw-r--r-- | src/lib/Bcfg2/Server/Lint/RequiredAttrs.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py b/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py index 5d9e229fa..109ace61f 100644 --- a/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py +++ b/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py @@ -183,6 +183,16 @@ class RequiredAttrs(Bcfg2.Server.Lint.ServerPlugin): "//*[substring(name(), 1, 5) = 'Bound']"): self.check_entry(path, bundle.name) + # ensure that abstract Path tags have either name + # or glob specified + for path in bundle.xdata.xpath("//Path"): + if ('name' not in path.attrib and + 'glob' not in path.attrib): + self.LintError( + "required-attrs-missing", + "Path tags require either a 'name' or 'glob' " + "attribute: \n%s" % self.RenderXML(path)) + def check_entry(self, entry, filename): """ Generic entry check. |