noc.cm.validators.interface.descriptionmatchre

Module Contents

class noc.cm.validators.interface.descriptionmatchre.InterfaceDescriptionMatchRegexpValidator

Bases: noc.cm.validators.clipsinterface.CLIPSInterfaceValidator

TITLE = Interface description *MUST MATCH* regex
DESCRIPTION = Interface description MUST MATCH regular expression
TAGS = ['description']
CONFIG_FORM
RULES = (defrule {{RULENAME}} (interface (name "{{name}}") (admin_status 1) (description ?d)) (test (not (match-re "{{regex}}" ?d))) => (assert (error (type "Interface | Invalid Description") (obj "{{name}}") (msg "{{regex}}") ) ) )