@check_empty()<EOL>def netmask_to_cidr(value):
return netaddr.IPAddress(value).netmask_bits()<EOL>
Converts a network mask to it's CIDR value.

Examples:
    >>> "{{ '255.255.255.0'|netmask_to_cidr }}" -> "24"