From b9e079a928a3763e5cffa668d460006f19436be4 Mon Sep 17 00:00:00 2001 From: byilmazturk Date: Tue, 28 Jul 2015 14:18:44 +0300 Subject: [PATCH] run unit tests before commit. correct unit test errors. --- master/buildbot/config.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/master/buildbot/config.py b/master/buildbot/config.py index 0bb9df92c66..4f56eb580a2 100644 --- a/master/buildbot/config.py +++ b/master/buildbot/config.py @@ -24,6 +24,7 @@ from buildbot.util import config as util_config from buildbot.util import safeTranslate from buildbot.util import service as util_service +from buildbot.util import identifiers as util_identifiers from buildbot.www import auth from buildbot.www import avatar from twisted.python import failure @@ -538,20 +539,25 @@ def load_slaves(self, filename, config_dict): error(msg) return + # if sl.slavename in ("debug", "change", "status"): + # msg = "slave name '%s' is reserved" % sl.slavename + # error(msg) + + #if not util.identifiers.isIdentifier(50, sl.slavename): def validate(slavename): - if sl.slavename in ("debug", "change", "status"): - yield "slave name %r - is reserved" % slavename + if slavename in ("debug", "change", "status"): + yield "slave name '%s' is reserved" % slavename if not isinstance(slavename, unicode): yield "slave name %r - is not a unicode string" % slavename - if not util.identifiers.ident_re.match(slavename): + if not util_identifiers.ident_re.match(slavename): yield "slave name %r - is not an identifier" % slavename if len(slavename) < 1: yield "slave name %r - identifiers cannot be an empty string" % slavename if len(slavename) > 50: yield "slave name %r - is longer than %d characters" % (slavename, 50) - for msg in validate(sl.slavename): - error(msg) + for msg in validate(sl.slavename): + error(msg) self.slaves = config_dict['slaves']