summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2011-05-10 11:23:45 -0500
committerNarayan Desai <desai@mcs.anl.gov>2011-05-10 11:23:45 -0500
commitf2d218ccd2de93ef639347933ba127ef081b4401 (patch)
tree9ae8cd46ca7265251b7d3e726a37d76490c21289 /src
parent73a4e8648c501437b3b1f4bd95e9c4023da9b681 (diff)
downloadbcfg2-f2d218ccd2de93ef639347933ba127ef081b4401.tar.gz
bcfg2-f2d218ccd2de93ef639347933ba127ef081b4401.tar.bz2
bcfg2-f2d218ccd2de93ef639347933ba127ef081b4401.zip
GroupPatterns: add support for multiple group targets in a single clause
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Plugins/GroupPatterns.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/lib/Server/Plugins/GroupPatterns.py b/src/lib/Server/Plugins/GroupPatterns.py
index 3801a6a08..553f9d286 100644
--- a/src/lib/Server/Plugins/GroupPatterns.py
+++ b/src/lib/Server/Plugins/GroupPatterns.py
@@ -76,14 +76,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" % \