diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Server/Plugins/GroupPatterns.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/lib/Server/Plugins/GroupPatterns.py b/src/lib/Server/Plugins/GroupPatterns.py index f99026a9d..7faead39a 100644 --- a/src/lib/Server/Plugins/GroupPatterns.py +++ b/src/lib/Server/Plugins/GroupPatterns.py @@ -83,14 +83,13 @@ class PatternFile(Bcfg2.Server.Plugin.SingleXMLFileBacked): return for entry in parsed.findall('GroupPattern'): try: - pat = None - rng = None - if entry.find('NamePattern') is not None: - pat = entry.find('NamePattern').text - if entry.find('NameRange') is not None: - rng = entry.find('NameRange').text groups = [g.text for g in entry.findall('Group')] - self.patterns.append(PatternMap(pat, rng, groups)) + for pat_ent in entry.findall('NamePattern'): + pat = pat_ent.text + self.patterns.append(PatternMap(pat, None, groups)) + for range_ent in entry.findall('NameRange'): + rng = range_ent.text + self.patterns.append(PatternMap(None, rng, groups)) except: Bcfg2.Server.Plugin.logger.error(\ "GroupPatterns: Failed to initialize pattern %s" % \ |