Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(867)

Unified Diff: third_party/buildbot_8_4p1/buildbot/status/web/base.py

Issue 1440163005: Allow users to customize the sanity-checking regexes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/buildbot_8_4p1/buildbot/status/web/base.py
diff --git a/third_party/buildbot_8_4p1/buildbot/status/web/base.py b/third_party/buildbot_8_4p1/buildbot/status/web/base.py
index 0fe0072deb4b1e78660f6564b9a0b657e3e32ef4..560d50cf80f12763985260cb824b761ada63c732 100644
--- a/third_party/buildbot_8_4p1/buildbot/status/web/base.py
+++ b/third_party/buildbot_8_4p1/buildbot/status/web/base.py
@@ -62,11 +62,14 @@ css_classes = {SUCCESS: "success",
def getAndCheckProperties(req):
"""
-Fetch custom build properties from the HTTP request of a "Force build" or
-"Resubmit build" HTML form.
-Check the names for valid strings, and return None if a problem is found.
-Return a new Properties object containing each property found in req.
-"""
+ Fetch custom build properties from the HTTP request of a "Force build" or
+ "Resubmit build" HTML form.
+ Check the names for valid strings, and return None if a problem is found.
+ Return a new Properties object containing each property found in req.
+ """
+ master = req.site.buildbot_service.master
+ pname_validate = master.config.validation['property_name']
+ pval_validate = master.config.validation['property_value']
properties = Properties()
i = 1
while True:
@@ -74,8 +77,8 @@ Return a new Properties object containing each property found in req.
pvalue = req.args.get("property%dvalue" % i, [""])[0]
if not pname:
break
- if not re.match(r'^[\w\.\-\/\~:]*$', pname) \
- or not re.match(r'^[\w\.\-\/\~:]*$', pvalue):
+ if not pname_validate.match(pname) \
+ or pval_validate.match(pvalue):
log.msg("bad property name='%s', value='%s'" % (pname, pvalue))
return None
properties.setProperty(pname, pvalue, "Force Build Form")
« no previous file with comments | « third_party/buildbot_8_4p1/buildbot/master.py ('k') | third_party/buildbot_8_4p1/buildbot/status/web/builder.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698