def Validate(self): result = Action.Validate(self) if (self.hive is None): result.append(ValidationFailure(self, 'Invalid Hive: {0}'.format(self.execparams['regkey'].split('\\', 1)[0]))) if ((self.execparams.get('regvalue') is None) and (self.execparams.get('regdata') is not None)): result.append(ValidationFailure(self, 'You cannot have a regdata without a regvalue.')) return result
def Validate(self): valid = Action.Validate(self) goodif = self.execparams.get('goodif', None) if (goodif is not None): try: parsed = self._parseIt(goodif) for (ndx, item) in enumerate(parsed): if (not (item in self.validstatements)): valid.append( ValidationFailure( self, ('%s is not a valid SafetyCheck Statement' % item))) if (item in self.binaryops): if (((ndx - 1) < 0) or ((ndx + 1) > len(parsed)) or (parsed[(ndx - 1)] not in self.conds) or (parsed[(ndx + 1)] not in self.conds)): valid.append( ValidationFailure( self, 'Invalid use of binary operator!')) except SyntaxError: psplog.critical('Unable to parse the SafetyCheck line!', exc_info=True) valid.append( ValidationFailure(self, 'Unable to parse the SafetyCheck line!')) return valid
def Validate(self): Action.Validate(self) if (self.parent is None): raise AttributeError('The Process Action cannot ride the rollercoaster by itself! (It needs a parent)') if isinstance(self.parent, ProcessableAction): return self.parent.validateprocess(self.execparams) else: raise AttributeError('The parent action is not processable.')