Beispiel #1
0
 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)
Beispiel #2
0
    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)
Beispiel #3
0
 def dd(err):
     print(("%s" % err))
     return ConfigValidationError(err.message)
Beispiel #4
0
 def reducer(acc, x):
     return Fail(
         ConfigValidationError(
             "Property does not exist in configuration: %s" %
             x)) if x not in block else OK(None)