From a4259a04b8ded673ed79b41f3bd72f43b9d5e22f Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Tue, 10 Jan 2012 11:42:19 -0500 Subject: made Rules try matching Path entries with and without trailing slash (#967) --- src/lib/Server/Plugins/Rules.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/lib/Server/Plugins/Rules.py b/src/lib/Server/Plugins/Rules.py index a146dca6a..32552f25f 100644 --- a/src/lib/Server/Plugins/Rules.py +++ b/src/lib/Server/Plugins/Rules.py @@ -28,6 +28,14 @@ class Rules(Bcfg2.Server.Plugin.PrioDir): def _matches(self, entry, metadata, rules): if Bcfg2.Server.Plugin.PrioDir._matches(self, entry, metadata, rules): return True + elif (entry.tag == "Path" and + ((entry.get('name').endswith("/") and + entry.get('name').rstrip("/") in rules) or + (not entry.get('name').endswith("/") and + entry.get('name') + '/' in rules))): + # special case for Path tags: + # http://trac.mcs.anl.gov/projects/bcfg2/ticket/967 + return True else: # attempt regular expression matching for rule in rules: -- cgit v1.2.3-1-g7c22