From 8eef2c9e6ef9e7dd7be0e0d85b2c6616d0622e3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Wei=C3=9F?= Date: Wed, 21 Sep 2011 22:30:40 +0200 Subject: bcfg2-lint: Honor the "empty" attribute When checking entries, don't complain about missing text if the "empty" attribute is set to true. --- src/lib/Server/Lint/RequiredAttrs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/Server/Lint/RequiredAttrs.py b/src/lib/Server/Lint/RequiredAttrs.py index c021c2764..f11ad9217 100644 --- a/src/lib/Server/Lint/RequiredAttrs.py +++ b/src/lib/Server/Lint/RequiredAttrs.py @@ -120,7 +120,8 @@ class RequiredAttrs(Bcfg2.Server.Lint.ServerPlugin): if '__text__' in required_attrs: required_attrs.remove('__text__') - if not entry.text: + if (not entry.text and + not entry.get('empty', 'false').lower() == 'true'): self.LintError("required-attrs-missing", "Text missing for %s %s in %s: %s" % (entry.tag, name, filename, -- cgit v1.2.3-1-g7c22