@staticmethod
def _get_filter_from_rule(rule):
    """Parse the firewall rule to a tuple

        :param rule: firewall rule
        :return: a tuple of parsed information
        """
    rule_filter = []
    keys = ['ip_version', 'protocol', 'source_port', 'destination_port',
        'source_ip_address', 'destination_ip_address']
    for key in keys:
        if key in ['source_port', 'destination_port']:
            port_range = rule.get(key, [])
            if port_range:
                port_lower, sep, port_upper = port_range.partition(':')
                port_upper = port_upper if sep else port_lower
                port_range = [port_lower, port_upper]
            rule_filter.append(port_range or [])
        else:
            rule_filter.append(rule.get(key, []))
    return tuple(rule_filter)
