diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2011-06-26 16:24:26 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2011-06-26 16:24:26 -0500 |
commit | 1274a0bc1a9021ed06d54227cbdfb8c24670ed0f (patch) | |
tree | 23bba2f0e7379aad10136574c075815671bcc6db /src/lib | |
parent | 3e5456932f02e1892d9733887669b0479ca99493 (diff) | |
parent | 4849378a62ab0dbf72f8ce4e6b2073dc73f2337a (diff) | |
download | bcfg2-1274a0bc1a9021ed06d54227cbdfb8c24670ed0f.tar.gz bcfg2-1274a0bc1a9021ed06d54227cbdfb8c24670ed0f.tar.bz2 bcfg2-1274a0bc1a9021ed06d54227cbdfb8c24670ed0f.zip |
Merge branch 'master' of git.mcs.anl.gov:/bcfg2
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" % \ |