diff --git a/config/interface.py b/config/interface.py index 808bd18..2433cd0 100644 --- a/config/interface.py +++ b/config/interface.py @@ -415,9 +415,6 @@ def validate_interfaces(yaml): iface_lcp = get_lcp(yaml, ifname) iface_address = has_address(yaml, ifname) - if iface_address and not iface_lcp: - msgs.append("interface %s has an address but no LCP" % ifname) - result = False if is_l2(yaml, ifname) and iface_lcp: msgs.append("interface %s is in L2 mode but has LCP name %s" % (ifname, iface_lcp)) result = False @@ -511,10 +508,6 @@ 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 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) result = False diff --git a/unittest/yaml/error-bridgedomain3.yaml b/unittest/yaml/error-bridgedomain3.yaml index 5890958..18dae0e 100644 --- a/unittest/yaml/error-bridgedomain3.yaml +++ b/unittest/yaml/error-bridgedomain3.yaml @@ -2,12 +2,10 @@ test: description: "Interfaces put into the bridge, can't be L3 (so cannot have an address)" errors: expected: - - "interface .* has an address but no 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" - count: 9 + count: 6 --- interfaces: GigabitEthernet1/0/0: diff --git a/unittest/yaml/error-subinterface5.yaml b/unittest/yaml/error-subinterface5.yaml deleted file mode 100644 index 21bd6e1..0000000 --- a/unittest/yaml/error-subinterface5.yaml +++ /dev/null @@ -1,18 +0,0 @@ -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 an LCP" - count: 1 ---- -interfaces: - GigabitEthernet1/0/0: - sub-interfaces: - 100: - addresses: [ 192.0.2.1/24 ] - GigabitEthernet2/0/0: - lcp: "xe2-0-0" - sub-interfaces: - 100: - addresses: [ 192.168.1.1/24 ] -