Reformat with blcak 25.1.0 - to match GitHub
Some checks failed
Lint / lint (push) Has been cancelled
Some checks failed
Lint / lint (push) Has been cancelled
This commit is contained in:
@ -13,4 +13,4 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
""" __init__.py added to suppress pylint error """
|
"""__init__.py added to suppress pylint error"""
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
""" A vppcfg configuration module that exposes its semantic/syntax validators """
|
"""A vppcfg configuration module that exposes its semantic/syntax validators"""
|
||||||
from __future__ import (
|
from __future__ import (
|
||||||
absolute_import,
|
absolute_import,
|
||||||
division,
|
division,
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
""" A vppcfg configuration module that validates acls """
|
"""A vppcfg configuration module that validates acls"""
|
||||||
import logging
|
import logging
|
||||||
import socket
|
import socket
|
||||||
import ipaddress
|
import ipaddress
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
""" A vppcfg configuration module that handles addresses """
|
"""A vppcfg configuration module that handles addresses"""
|
||||||
import ipaddress
|
import ipaddress
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
""" A vppcfg configuration module that handles bondethernets """
|
"""A vppcfg configuration module that handles bondethernets"""
|
||||||
import logging
|
import logging
|
||||||
from . import interface
|
from . import interface
|
||||||
from . import mac
|
from . import mac
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
""" A vppcfg configuration module that handles bridgedomains """
|
"""A vppcfg configuration module that handles bridgedomains"""
|
||||||
import logging
|
import logging
|
||||||
from . import interface
|
from . import interface
|
||||||
from . import loopback
|
from . import loopback
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
""" A vppcfg configuration module that validates interfaces """
|
"""A vppcfg configuration module that validates interfaces"""
|
||||||
import logging
|
import logging
|
||||||
from . import bondethernet
|
from . import bondethernet
|
||||||
from . import bridgedomain
|
from . import bridgedomain
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
""" A vppcfg configuration module that validates Linux Control Plane (lcp) elements """
|
"""A vppcfg configuration module that validates Linux Control Plane (lcp) elements"""
|
||||||
|
|
||||||
|
|
||||||
def get_lcps(yaml, interfaces=True, loopbacks=True, bridgedomains=True):
|
def get_lcps(yaml, interfaces=True, loopbacks=True, bridgedomains=True):
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
""" A vppcfg configuration module that validates loopbacks """
|
"""A vppcfg configuration module that validates loopbacks"""
|
||||||
import logging
|
import logging
|
||||||
from . import lcp
|
from . import lcp
|
||||||
from . import address
|
from . import address
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
""" A vppcfg configuration module that validates MAC addresses """
|
"""A vppcfg configuration module that validates MAC addresses"""
|
||||||
import netaddr
|
import netaddr
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
""" A vppcfg configuration module that validates prefixlists """
|
"""A vppcfg configuration module that validates prefixlists"""
|
||||||
import logging
|
import logging
|
||||||
import ipaddress
|
import ipaddress
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
""" A vppcfg configuration module that validates sflow config """
|
"""A vppcfg configuration module that validates sflow config"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
""" A vppcfg configuration module that validates taps """
|
"""A vppcfg configuration module that validates taps"""
|
||||||
import logging
|
import logging
|
||||||
from . import mac
|
from . import mac
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
""" Unit tests for taps """
|
"""Unit tests for taps"""
|
||||||
import unittest
|
import unittest
|
||||||
import yaml
|
import yaml
|
||||||
from . import acl
|
from . import acl
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
""" Unit tests for addresses """
|
"""Unit tests for addresses"""
|
||||||
import unittest
|
import unittest
|
||||||
import yaml
|
import yaml
|
||||||
from . import address
|
from . import address
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
""" Unit tests for bondethernet """
|
"""Unit tests for bondethernet"""
|
||||||
import unittest
|
import unittest
|
||||||
import yaml
|
import yaml
|
||||||
from . import bondethernet
|
from . import bondethernet
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
""" Unit tests for bridgedomains """
|
"""Unit tests for bridgedomains"""
|
||||||
import unittest
|
import unittest
|
||||||
import yaml
|
import yaml
|
||||||
from . import bridgedomain
|
from . import bridgedomain
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
""" Unit tests for interfaces """
|
"""Unit tests for interfaces"""
|
||||||
import unittest
|
import unittest
|
||||||
import yaml
|
import yaml
|
||||||
from . import interface
|
from . import interface
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
""" Unit tests for LCPs """
|
"""Unit tests for LCPs"""
|
||||||
import unittest
|
import unittest
|
||||||
import yaml
|
import yaml
|
||||||
from . import lcp
|
from . import lcp
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
""" Unit tests for loopbacks """
|
"""Unit tests for loopbacks"""
|
||||||
import unittest
|
import unittest
|
||||||
import yaml
|
import yaml
|
||||||
from . import loopback
|
from . import loopback
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
""" Unit tests for MAC addresses """
|
"""Unit tests for MAC addresses"""
|
||||||
import unittest
|
import unittest
|
||||||
from . import mac
|
from . import mac
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
""" Unit tests for taps """
|
"""Unit tests for taps"""
|
||||||
import unittest
|
import unittest
|
||||||
import yaml
|
import yaml
|
||||||
from . import prefixlist
|
from . import prefixlist
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
""" Unit tests for taps """
|
"""Unit tests for taps"""
|
||||||
import unittest
|
import unittest
|
||||||
import yaml
|
import yaml
|
||||||
from . import tap
|
from . import tap
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
""" Unit tests for vxlan_tunnels """
|
"""Unit tests for vxlan_tunnels"""
|
||||||
import unittest
|
import unittest
|
||||||
import yaml
|
import yaml
|
||||||
from . import vxlan_tunnel
|
from . import vxlan_tunnel
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
""" module to help locate unittest resources """
|
"""module to help locate unittest resources"""
|
||||||
|
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
#
|
#
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
""" A vppcfg configuration module that validates vxlan_tunnels """
|
"""A vppcfg configuration module that validates vxlan_tunnels"""
|
||||||
import logging
|
import logging
|
||||||
import ipaddress
|
import ipaddress
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
""" This is a unit test suite for vppcfg """
|
"""This is a unit test suite for vppcfg"""
|
||||||
# pylint: disable=duplicate-code
|
# pylint: disable=duplicate-code
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
@ -13,4 +13,4 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
""" __init__.py added to suppress pylint error """
|
"""__init__.py added to suppress pylint error"""
|
||||||
|
@ -309,9 +309,9 @@ class Dumper(VPPApi):
|
|||||||
acl_rule.srcport_or_icmptype_first
|
acl_rule.srcport_or_icmptype_first
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
config_term[
|
config_term["icmp-type"] = (
|
||||||
"icmp-type"
|
f"{acl_rule.srcport_or_icmptype_first}-{maxval}"
|
||||||
] = f"{acl_rule.srcport_or_icmptype_first}-{maxval}"
|
)
|
||||||
|
|
||||||
maxval = acl_rule.dstport_or_icmpcode_last
|
maxval = acl_rule.dstport_or_icmpcode_last
|
||||||
if maxval > 255:
|
if maxval > 255:
|
||||||
@ -324,9 +324,9 @@ class Dumper(VPPApi):
|
|||||||
acl_rule.dstport_or_icmpcode_first
|
acl_rule.dstport_or_icmpcode_first
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
config_term[
|
config_term["icmp-code"] = (
|
||||||
"icmp-code"
|
f"{acl_rule.dstport_or_icmpcode_first}-{maxval}"
|
||||||
] = f"{acl_rule.dstport_or_icmpcode_first}-{maxval}"
|
)
|
||||||
elif acl_rule.proto in [6, 17]:
|
elif acl_rule.proto in [6, 17]:
|
||||||
if acl_rule.proto == 6:
|
if acl_rule.proto == 6:
|
||||||
config_term["protocol"] = "tcp"
|
config_term["protocol"] = "tcp"
|
||||||
@ -340,9 +340,9 @@ class Dumper(VPPApi):
|
|||||||
acl_rule.srcport_or_icmptype_first
|
acl_rule.srcport_or_icmptype_first
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
config_term[
|
config_term["source-port"] = (
|
||||||
"source-port"
|
f"{acl_rule.srcport_or_icmptype_first}-{acl_rule.srcport_or_icmptype_last}"
|
||||||
] = f"{acl_rule.srcport_or_icmptype_first}-{acl_rule.srcport_or_icmptype_last}"
|
)
|
||||||
if (
|
if (
|
||||||
acl_rule.dstport_or_icmpcode_first
|
acl_rule.dstport_or_icmpcode_first
|
||||||
== acl_rule.dstport_or_icmpcode_last
|
== acl_rule.dstport_or_icmpcode_last
|
||||||
@ -351,9 +351,9 @@ class Dumper(VPPApi):
|
|||||||
acl_rule.dstport_or_icmpcode_first
|
acl_rule.dstport_or_icmpcode_first
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
config_term[
|
config_term["destination-port"] = (
|
||||||
"destination-port"
|
f"{acl_rule.dstport_or_icmpcode_first}-{acl_rule.dstport_or_icmpcode_last}"
|
||||||
] = f"{acl_rule.dstport_or_icmpcode_first}-{acl_rule.dstport_or_icmpcode_last}"
|
)
|
||||||
else:
|
else:
|
||||||
config_term["protocol"] = int(acl_rule.proto)
|
config_term["protocol"] = int(acl_rule.proto)
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#
|
#
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
"""vppcfg is a utility to configure a running VPP Dataplane using YAML
|
"""vppcfg is a utility to configure a running VPP Dataplane using YAML
|
||||||
config files. See http://github.com/pimvanpelt/vppcfg/README.md for details. """
|
config files. See http://github.com/pimvanpelt/vppcfg/README.md for details."""
|
||||||
# pylint: disable=duplicate-code
|
# pylint: disable=duplicate-code
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
Reference in New Issue
Block a user