- conform_action_type=getattr(
- PolicerAction, conform_action_type.upper()
- ).value,
- conform_dscp=getattr(DSCP, f"D_{conform_dscp.upper()}").value
- if
- conform_action_type.upper() == PolicerAction.MARK_AND_TRANSMIT.name
- else 0,
- exceed_action_type=getattr(
- PolicerAction, exceed_action_type.upper()
- ).value,
- exceed_dscp=getattr(DSCP, f"D_{exceed_dscp.upper()}").value
- if
- exceed_action_type.upper() == PolicerAction.MARK_AND_TRANSMIT.name
- else 0,
- violate_action_type=getattr(
- PolicerAction, violate_action_type.upper()
- ).value,
- violate_dscp=getattr(DSCP, f"D_{violate_dscp.upper()}").value
- if
- violate_action_type.upper() == PolicerAction.MARK_AND_TRANSMIT.name
- else 0,
- color_aware=1 if color_aware == u"'ca'" else 0
+ conform_action=conform_action,
+ exceed_action=exceed_action,
+ violate_action=violate_action,
+ color_aware=bool(color_aware == u"'ca'")