def confValidateName(self, name): if name != self.name: return Fail( ConfigValidationError( "Invalid name property in configuration (got %s expected %s)" % (config.get('name'), self.name))) return OK(name)
def confValidateDevroot(self, devroot): path = devroot.get('path', '') path = os.path.expanduser(path) if not path: return Fail(ConfigValidationError("devroot path configuration is missing.")) elif not os.path.isdir(path): self.logAdapter.info( "WARNING: devroot '%s' does not exist locally." % path) mode = devroot.get('mode', None) if not mode: return Fail(ConfigValidationError("devroot mode is not set.")) elif mode not in ['sharedfolder', 'rsync', 'unison']: # XXX Fix hardcoded values. return Fail(ConfigValidationError("devroot mode '%s' is not valid." % mode)) return OK(devroot)
def dd(err): print(("%s" % err)) return ConfigValidationError(err.message)
def reducer(acc, x): return Fail( ConfigValidationError( "Property does not exist in configuration: %s" % x)) if x not in block else OK(None)