

def delete_rule(name, localport, protocol='tcp', dir='in'):
    "\n    .. versionadded:: 2015.8.0\n\n    Delete an existing firewall rule\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' firewall.delete_rule 'test' '8080' 'tcp' 'in'\n    "
    cmd = ['netsh', 'advfirewall', 'firewall', 'delete', 'rule', 'name={0}'.format(name), 'protocol={0}'.format(protocol), 'dir={0}'.format(dir)]
    if (('icmpv4' not in protocol) and ('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/original