Formatting w/ black

This commit is contained in:
Pim van Pelt
2022-04-24 10:41:35 +00:00
parent 1a1760d45c
commit 71ea1823f4
6 changed files with 14 additions and 8 deletions

View File

@ -76,6 +76,7 @@ class Validator:
The purpose is to ensure that the YAML file is both syntactically correct, The purpose is to ensure that the YAML file is both syntactically correct,
which is ensured by Yamale, and semantically correct, which is ensured by a set which is ensured by Yamale, and semantically correct, which is ensured by a set
of built-in validators, and user-added validators (see the add_validator() method).""" of built-in validators, and user-added validators (see the add_validator() method)."""
def __init__(self, schema): def __init__(self, schema):
self.logger = logging.getLogger("vppcfg.config") self.logger = logging.getLogger("vppcfg.config")
self.logger.addHandler(logging.NullHandler()) self.logger.addHandler(logging.NullHandler())

View File

@ -39,6 +39,7 @@ def example_validator(_yaml):
class YAMLTest(unittest.TestCase): class YAMLTest(unittest.TestCase):
"""This test suite takes a YAML configuration file and holds it against the syntax """This test suite takes a YAML configuration file and holds it against the syntax
(Yamale) and semantic validators, returning errors in case of validation failures.""" (Yamale) and semantic validators, returning errors in case of validation failures."""
def __init__(self, testName, yaml_filename, yaml_schema): def __init__(self, testName, yaml_filename, yaml_schema):
# calling the super class init varies for different python versions. This works for 2.7 # calling the super class init varies for different python versions. This works for 2.7
super().__init__(testName) super().__init__(testName)

View File

@ -45,7 +45,9 @@ class Applier(VPPApi):
"""Delete a sub-int identified by name (ie GigabitEthernet3/0/0.100)""" """Delete a sub-int identified by name (ie GigabitEthernet3/0/0.100)"""
pass pass
def set_interface_l2_tag_rewrite(self, ifname, vtr_op, vtr_push_dot1q, vtr_tag1, vtr_tag2): def set_interface_l2_tag_rewrite(
self, ifname, vtr_op, vtr_push_dot1q, vtr_tag1, vtr_tag2
):
"""Set l2 tag rewrite on an interface identified by name (ie GigabitEthernet3/0/0.100) """Set l2 tag rewrite on an interface identified by name (ie GigabitEthernet3/0/0.100)
into a certain operational mode. TODO(pim) clarify the vtr_* arguments.""" into a certain operational mode. TODO(pim) clarify the vtr_* arguments."""
## somewhere in interface.api see vtr_* fields ## somewhere in interface.api see vtr_* fields

View File

@ -30,6 +30,7 @@ class Dumper(VPPApi):
Note that not all running VPP configs are "valid" in vppcfg's eyes. It is not Note that not all running VPP configs are "valid" in vppcfg's eyes. It is not
guaranteed that the output of the Dumper() will stand validation.""" guaranteed that the output of the Dumper() will stand validation."""
def __init__(self, address="/run/vpp/api.sock", clientname="vppcfg"): def __init__(self, address="/run/vpp/api.sock", clientname="vppcfg"):
VPPApi.__init__(self, address, clientname) VPPApi.__init__(self, address, clientname)

View File

@ -27,6 +27,7 @@ from vpp_papi import VPPApiClient
class VPPApi: class VPPApi:
"""The VPPApi class is a base class that abstracts the vpp_papi.""" """The VPPApi class is a base class that abstracts the vpp_papi."""
def __init__(self, address="/run/vpp/api.sock", clientname="vppcfg"): def __init__(self, address="/run/vpp/api.sock", clientname="vppcfg"):
self.logger = logging.getLogger("vppcfg.vppapi") self.logger = logging.getLogger("vppcfg.vppapi")
self.logger.addHandler(logging.NullHandler()) self.logger.addHandler(logging.NullHandler())