def delete_rule(name, localport, protocol='tcp', dir='in'):
    '''
    .. versionadded:: 2015.8.0

    Delete an existing firewall rule

    CLI Example:

    .. code-block:: bash

        salt '*' firewall.delete_rule 'test' '8080' 'tcp' 'in'
    '''
    cmd = ['netsh', 'advfirewall', 'firewall', 'delete', 'rule',
           'name={0}'.format(name),
           'protocol={0}'.format(protocol),
           'dir={0}'.format(dir)]

    if 'icmpv4' not in protocol or 'icmpv6' not in protocol:
        cmd.append('localport={0}'.format(localport))

    ret = __salt__['cmd.run'](cmd, python_shell=False)
    if isinstance(ret, six.string_types):
        return ret.endswith('Ok.')
    else:
        log.error('firewall.delete_rule failed: {0}'.format(ret))
        return False
dataset/ETHPy150Open saltstack/salt/salt/modules/win_firewall.py/delete_rule/operator `and` -> `or`