Formatting w/ black
This commit is contained in:
@ -76,6 +76,7 @@ class Validator:
|
||||
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
|
||||
of built-in validators, and user-added validators (see the add_validator() method)."""
|
||||
|
||||
def __init__(self, schema):
|
||||
self.logger = logging.getLogger("vppcfg.config")
|
||||
self.logger.addHandler(logging.NullHandler())
|
||||
|
1
tests.py
1
tests.py
@ -39,6 +39,7 @@ def example_validator(_yaml):
|
||||
class YAMLTest(unittest.TestCase):
|
||||
"""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."""
|
||||
|
||||
def __init__(self, testName, yaml_filename, yaml_schema):
|
||||
# calling the super class init varies for different python versions. This works for 2.7
|
||||
super().__init__(testName)
|
||||
|
@ -45,7 +45,9 @@ class Applier(VPPApi):
|
||||
"""Delete a sub-int identified by name (ie GigabitEthernet3/0/0.100)"""
|
||||
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)
|
||||
into a certain operational mode. TODO(pim) clarify the vtr_* arguments."""
|
||||
## somewhere in interface.api see vtr_* fields
|
||||
|
@ -30,6 +30,7 @@ class Dumper(VPPApi):
|
||||
|
||||
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."""
|
||||
|
||||
def __init__(self, address="/run/vpp/api.sock", clientname="vppcfg"):
|
||||
VPPApi.__init__(self, address, clientname)
|
||||
|
||||
|
@ -27,6 +27,7 @@ from vpp_papi import VPPApiClient
|
||||
|
||||
class VPPApi:
|
||||
"""The VPPApi class is a base class that abstracts the vpp_papi."""
|
||||
|
||||
def __init__(self, address="/run/vpp/api.sock", clientname="vppcfg"):
|
||||
self.logger = logging.getLogger("vppcfg.vppapi")
|
||||
self.logger.addHandler(logging.NullHandler())
|
||||
|
Reference in New Issue
Block a user