From 27ce2351c7a370d0d1c4b2079ee7ccef9b8c3ad9 Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Tue, 22 Mar 2022 18:49:31 +0000 Subject: [PATCH] Cosmetic: use '.. LCP' consistently --- unittest/yaml/error-bridgedomain3.yaml | 2 +- unittest/yaml/error-subinterface2.yaml | 2 +- unittest/yaml/error-subinterface3.yaml | 4 ++-- unittest/yaml/error-subinterface5.yaml | 2 +- validator/interface.py | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/unittest/yaml/error-bridgedomain3.yaml b/unittest/yaml/error-bridgedomain3.yaml index 1da53b4..5890958 100644 --- a/unittest/yaml/error-bridgedomain3.yaml +++ b/unittest/yaml/error-bridgedomain3.yaml @@ -3,7 +3,7 @@ test: errors: expected: - "interface .* has an address but no LCP" - - "sub-interface .* has an address but .* does not have LCP" + - "sub-interface .* has an address but .* does not have an LCP" - "bridgedomain .* member .* has an address" - "interface .* is in L2 mode but has an address" - "sub-interface .* is in L2 mode but has an address" diff --git a/unittest/yaml/error-subinterface2.yaml b/unittest/yaml/error-subinterface2.yaml index 022387d..f6d90e3 100644 --- a/unittest/yaml/error-subinterface2.yaml +++ b/unittest/yaml/error-subinterface2.yaml @@ -2,7 +2,7 @@ test: description: "A subinterface cannot have an LCP if the parent doesn't have one" errors: expected: - - "sub-interface .* has LCP name .* but .* does not have LCP" + - "sub-interface .* has LCP name .* but .* does not have an LCP" count: 1 --- interfaces: diff --git a/unittest/yaml/error-subinterface3.yaml b/unittest/yaml/error-subinterface3.yaml index 87709f5..37867c1 100644 --- a/unittest/yaml/error-subinterface3.yaml +++ b/unittest/yaml/error-subinterface3.yaml @@ -2,8 +2,8 @@ test: description: "Children with an LCP require their parent to have one too" errors: expected: - - "sub-interface .* has LCP name .* but .* does not have LCP" - - "sub-interface .* is QinX and has LCP name .* but .* does not have LCP" + - "sub-interface .* has LCP name .* but .* does not have an LCP" + - "sub-interface .* is QinX and has LCP name .* but .* does not have an LCP" - "sub-interface .* has LCP name .* but its encapsulation is not exact-match" - "sub-interface .* has invalid encapsulation" count: 4 diff --git a/unittest/yaml/error-subinterface5.yaml b/unittest/yaml/error-subinterface5.yaml index 1e3d379..21bd6e1 100644 --- a/unittest/yaml/error-subinterface5.yaml +++ b/unittest/yaml/error-subinterface5.yaml @@ -2,7 +2,7 @@ test: description: "Sub-interface with addresses must have an LCP. Gi1/0/0 does this wrong, while Gi2/0/0 does it correctly" errors: expected: - - "sub-interface .* has an address but .* does not have LCP" + - "sub-interface .* has an address but .* does not have an LCP" count: 1 --- interfaces: diff --git a/validator/interface.py b/validator/interface.py index 749e3df..4435fab 100644 --- a/validator/interface.py +++ b/validator/interface.py @@ -442,7 +442,7 @@ def validate_interfaces(yaml): msgs.append("sub-interface %s does not have a unique LCP name %s" % (sub_ifname, sub_lcp)) result = False if sub_lcp and not iface_lcp: - msgs.append("sub-interface %s has LCP name %s but %s does not have LCP" % (sub_ifname, sub_lcp, ifname)) + msgs.append("sub-interface %s has LCP name %s but %s does not have an LCP" % (sub_ifname, sub_lcp, ifname)) result = False if sub_lcp and is_qinx(yaml, sub_ifname): mid_ifname, mid_iface = get_qinx_parent_by_name(yaml, sub_ifname) @@ -450,7 +450,7 @@ def validate_interfaces(yaml): msgs.append("sub-interface %s is QinX and has LCP name %s which requires a parent" % (sub_ifname, sub_lcp)) result = False elif not get_lcp(yaml, mid_ifname): - msgs.append("sub-interface %s is QinX and has LCP name %s but %s does not have LCP" % (sub_ifname, sub_lcp, mid_ifname)) + msgs.append("sub-interface %s is QinX and has LCP name %s but %s does not have an LCP" % (sub_ifname, sub_lcp, mid_ifname)) result = False if sub_lcp and 'encapsulation' in sub_iface and 'exact-match' in sub_iface['encapsulation'] and not sub_iface['encapsulation']['exact-match']: msgs.append("sub-interface %s has LCP name %s but its encapsulation is not exact-match" % (sub_ifname, sub_lcp)) @@ -460,7 +460,7 @@ def validate_interfaces(yaml): if has_address(yaml, sub_ifname): ## The sub_iface lcp is not required: it can be derived from the iface_lcp, which has to be set if not iface_lcp: - msgs.append("sub-interface %s has an address but %s does not have LCP" % (sub_ifname, ifname)) + msgs.append("sub-interface %s has an address but %s does not have an LCP" % (sub_ifname, ifname)) result = False if is_l2(yaml, sub_ifname): msgs.append("sub-interface %s is in L2 mode but has an address" % sub_ifname)