diff options
-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. |