diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Server/Plugins/Rules.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/lib/Server/Plugins/Rules.py b/src/lib/Server/Plugins/Rules.py index e8412c6f1..a146dca6a 100644 --- a/src/lib/Server/Plugins/Rules.py +++ b/src/lib/Server/Plugins/Rules.py @@ -12,12 +12,8 @@ class Rules(Bcfg2.Server.Plugin.PrioDir): def HandlesEntry(self, entry, metadata): if entry.tag in self.Entries: - if entry.get("name") in self.Entries[entry.tag]: - return True - else: - for rule in self.Entries[entry.tag].keys(): - if re.search(rule, entry.get('name')): - return True + return self._matches(entry, metadata, + self.Entries[entry.tag].keys()) return False def HandleEntry(self, entry, metadata): @@ -35,7 +31,7 @@ class Rules(Bcfg2.Server.Plugin.PrioDir): else: # attempt regular expression matching for rule in rules: - if re.search(rule, entry.get('name')): + if re.match("%s$" % rule, entry.get('name')): return True return False |