diff options
author | sarthurdev <965089+sarthurdev@users.noreply.github.com> | 2023-09-14 14:49:40 +0200 |
---|---|---|
committer | sarthurdev <965089+sarthurdev@users.noreply.github.com> | 2023-09-16 13:20:10 +0200 |
commit | 416faf18d08720852e3c4d36cb2394acdee1de0e (patch) | |
tree | cb448aea3e0390f5c338ddaa90e98e1844133952 /src/conf_mode | |
parent | 734d84f696944419a2d6f11bc16dda03900add34 (diff) | |
download | vyos-1x-416faf18d08720852e3c4d36cb2394acdee1de0e.tar.gz vyos-1x-416faf18d08720852e3c4d36cb2394acdee1de0e.zip |
nat: Remove deprecated kernel check
/usr/libexec/vyos/conf_mode/nat.py:21: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
from distutils.version import LooseVersion
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/nat.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/conf_mode/nat.py b/src/conf_mode/nat.py index c516a81fa..52a7a71fd 100755 --- a/src/conf_mode/nat.py +++ b/src/conf_mode/nat.py @@ -18,8 +18,6 @@ import jmespath import json import os -from distutils.version import LooseVersion -from platform import release as kernel_version from sys import exit from netifaces import interfaces @@ -39,10 +37,7 @@ from vyos import ConfigError from vyos import airbag airbag.enable() -if LooseVersion(kernel_version()) > LooseVersion('5.1'): - k_mod = ['nft_nat', 'nft_chain_nat'] -else: - k_mod = ['nft_nat', 'nft_chain_nat_ipv4'] +k_mod = ['nft_nat', 'nft_chain_nat'] nftables_nat_config = '/run/nftables_nat.conf' nftables_static_nat_conf = '/run/nftables_static-nat-rules.nft' |