diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-01-10 11:42:19 -0500 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-01-10 11:42:19 -0500 |
commit | a4259a04b8ded673ed79b41f3bd72f43b9d5e22f (patch) | |
tree | b850049323462902873fa5be154509dd0ee60a43 /src/lib | |
parent | 56844ada2926d6f7c17ab8274f878a0f8e801290 (diff) | |
download | bcfg2-a4259a04b8ded673ed79b41f3bd72f43b9d5e22f.tar.gz bcfg2-a4259a04b8ded673ed79b41f3bd72f43b9d5e22f.tar.bz2 bcfg2-a4259a04b8ded673ed79b41f3bd72f43b9d5e22f.zip |
made Rules try matching Path entries with and without trailing slash (#967)
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Server/Plugins/Rules.py | 8 |
1 files changed, 8 insertions, 0 deletions
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: |