Provides formatting functions for violations


Format the groups violation data into a tuple.

Parameters:violation (namedtuple) – The groups violation. This is a named tuple (see in
Yields:tuple – A tuple of the violation properties.

Format the policy violation data into a tuple.

Also flattens the RuleViolation, since it consists of the resource, rule, and members that don’t meet the rule criteria.

Various properties of RuleViolation may also have values that exceed the declared column length, so truncate as necessary to prevent MySQL errors.

Parameters:violation (namedtuple) – The Policy RuleViolation. This is a named tuple.
Yields:tuple – A tuple of the rule violation properties.