def save(filename=None, family='ipv4'):
    if _conf() and not filename:
        filename = _conf()

    nft_families = ['ip', 'ip6', 'arp', 'bridge']
    rules = "#! nft -f\n"
    for family in nft_families:
        out = get_rules(family)
        if out:
            rules += '\n'
        rules = rules + '\n'.join(out)
    rules = rules + '\n'

    try:
        with salt.utils.fopen(filename, 'w+') as _fh:
            # Write out any changes
            _fh.writelines(rules)
    except (IOError, OSError) as exc:
        raise CommandExecutionError(
            'Problem writing to configuration file: {0}'.format(exc)
        )
    return rules
Save the current in-memory rules to disk
dataset/ETHPy150Open saltstack/salt/salt/modules/nftables.py/save