summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-01-23 14:13:51 -0500
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-02-04 13:36:04 -0500
commitcfa769abf8e464acee43e1cac359b0f7e5fc5e4b (patch)
treeee6910881a67e792997ebf0b5ed74aca3263fbaf /src/lib/Bcfg2/Server/Lint/RequiredAttrs.py
parent22029e107420ff21cf9f1811bf4bb6dc2aba1dde (diff)
downloadbcfg2-cfa769abf8e464acee43e1cac359b0f7e5fc5e4b.tar.gz
bcfg2-cfa769abf8e464acee43e1cac359b0f7e5fc5e4b.tar.bz2
bcfg2-cfa769abf8e464acee43e1cac359b0f7e5fc5e4b.zip
added genshi support to StructFile
Diffstat (limited to 'src/lib/Bcfg2/Server/Lint/RequiredAttrs.py')
-rw-r--r--src/lib/Bcfg2/Server/Lint/RequiredAttrs.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py b/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py
index bf72d26d0..60525d5a1 100644
--- a/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py
+++ b/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py
@@ -3,12 +3,10 @@ verified with an XML schema alone"""
import os
import re
-import lxml.etree
import Bcfg2.Server.Lint
import Bcfg2.Client.Tools.POSIX
import Bcfg2.Client.Tools.VCS
from Bcfg2.Server.Plugins.Packages import Apt, Yum
-from Bcfg2.Server.Plugins.Bundler import BundleTemplateFile
# format verifying functions
@@ -178,16 +176,9 @@ class RequiredAttrs(Bcfg2.Server.Lint.ServerPlugin):
return
for bundle in self.core.plugins['Bundler'].entries.values():
- if (self.HandlesFile(bundle.name) and
- not isinstance(bundle, BundleTemplateFile)):
- try:
- xdata = lxml.etree.XML(bundle.data)
- except (lxml.etree.XMLSyntaxError, AttributeError):
- xdata = \
- lxml.etree.parse(bundle.template.filepath).getroot()
-
- for path in \
- xdata.xpath("//*[substring(name(), 1, 5) = 'Bound']"):
+ if self.HandlesFile(bundle.name) and bundle.template is None:
+ for path in bundle.xdata.xpath(
+ "//*[substring(name(), 1, 5) = 'Bound']"):
self.check_entry(path, bundle.name)
def check_entry(self, entry, filename):