Skip to content

Commit

Permalink
confd: fix pyang linter errors
Browse files Browse the repository at this point in the history
Issue #815 detail issues found running the Clixon Controllar and
Cisco Yangsuite.  The errors and warnings listed are very similar
to pyang, which the undersigned has, the following changes fixes
the pyang errors:

 - relocate 'feature containers' to submodule
 - drop already deviated ospf:database deviations
 - drop unused imports

Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Nov 18, 2024
1 parent bef31c5 commit 6c1b989
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 58 deletions.
4 changes: 2 additions & 2 deletions src/confd/yang/confd.inc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ MODULES=(
"[email protected]"
"[email protected]"
"[email protected]"
"infix-routing@2024-10-01.yang"
"infix-routing@2024-11-15.yang"
"[email protected]"
"[email protected]"
"[email protected]"
Expand All @@ -37,7 +37,7 @@ MODULES=(
"[email protected]"
"[email protected]"
"[email protected]"
"infix-interfaces@2024-11-12.yang -e vlan-filtering"
"infix-interfaces@2024-11-15.yang -e vlan-filtering"

# from rousette
"[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion src/confd/yang/containers.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- sh -*-
# REMEMBER TO UPDATE infix-interfaces ALSO IN confd.inc
MODULES=(
"infix-interfaces@2024-11-12.yang -e vlan-filtering -e containers"
"infix-interfaces@2024-11-15.yang -e vlan-filtering -e containers"
"[email protected]"
)
4 changes: 0 additions & 4 deletions src/confd/yang/infix-containers.yang
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ module infix-containers {
namespace "urn:ietf:params:xml:ns:yang:infix-containers";
prefix infix-cont;

import ietf-yang-types {
prefix yang;
}

import ietf-interfaces {
prefix if;
}
Expand Down
10 changes: 4 additions & 6 deletions src/confd/yang/infix-if-bridge.yang
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ submodule infix-if-bridge {
belongs-to infix-interfaces {
prefix infix-if;
}
import ietf-yang-types {
prefix yang;
}
import iana-if-type {
prefix ianaift;
}
Expand All @@ -15,9 +12,6 @@ submodule infix-if-bridge {
import ietf-interfaces {
prefix if;
}
import ietf-inet-types {
prefix inet;
}
import ietf-ip {
prefix ip;
}
Expand All @@ -32,6 +26,10 @@ submodule infix-if-bridge {
contact "[email protected]";
description "Linux bridge extension for ietf-interfaces.";

revision 2024-11-15 {
description "Fix pyang linter warnings, drop unused imports.";
reference "internal";
}
revision 2024-08-26 {
description "Improve must expressions for multicast.
Expand Down
File renamed without changes.
26 changes: 19 additions & 7 deletions src/confd/yang/infix-if-container.yang
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@ submodule infix-if-container {
import ietf-ip {
prefix ip;
}
import infix-if-type {
prefix infixift;
}

organization "KernelKit";
contact "[email protected]";
description "Container network to interface mapping for ietf-interfaces.
Ensures a container interface can never be a bridge port, or
LAG member, at the same time.";

revision 2024-11-15 {
description "Two changes:
- Relocate 'feature containers' declaration to here
- Fix pyang linter errors and warnings, dropping unused
imports and dropping the default value for subnet";
reference "internal";
}
revision 2024-10-29 {
description "Add read only container list to container-network";
reference "internal";
Expand All @@ -32,6 +36,14 @@ submodule infix-if-container {
reference "internal";
}

/*
* Features
*/

feature containers {
description "Containers is an optional build-time feature in Infix.";
}

/*
* Identities
*/
Expand Down Expand Up @@ -76,17 +88,17 @@ submodule infix-if-container {
list subnet {
description "Static IP ranges to hand out addresses to containers from.
If no subnet is provided, a default 172.17.0.0/16 one is
set up. This is the default in a standard Docker setup.
A container bridge forwards DNS, NTP, and SSH by default to
the host interfaces.";
when "../type = 'infix-if:bridge'";
key subnet;

leaf subnet {
type inet:ip-prefix;
description "Subnet to assign addresses from, round-robin assignment.
The default is from a standard Docker setup.";
default "172.17.0.0/16";
description "Subnet to assign addresses from, round-robin assignment.";
}

leaf gateway {
Expand Down
File renamed without changes.
18 changes: 6 additions & 12 deletions src/confd/yang/infix-interfaces.yang
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module infix-interfaces {
prefix infix-if;

import infix-if-type {
prefix infixift;
prefix infix-ift;
}
import ietf-interfaces {
prefix if;
Expand All @@ -23,8 +23,10 @@ module infix-interfaces {
contact "[email protected]";
description "Linux bridge and lag extensions for ietf-interfaces.";

revision 2024-11-12 {
description "Limit name 2-15 chars, Linux limitation.";
revision 2024-11-15 {
description "Two changes:
- Limit name 2-15 chars, Linux limitation
- Relocate 'feature containers' to submodule";
reference "internal";
}

Expand Down Expand Up @@ -74,22 +76,14 @@ module infix-interfaces {
reference "internal";
}

/*
* Features
*/

feature containers {
description "Containers is an optional build-time feature in Infix.";
}

/*
* Data Nodes
*/

deviation "/if:interfaces/if:interface/if:type" {
deviate replace {
type identityref {
base infixift:infix-interface-type;
base infix-ift:infix-interface-type;
}
}
}
Expand Down
File renamed without changes.
32 changes: 6 additions & 26 deletions src/confd/yang/infix-routing.yang
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ module infix-routing {
import ietf-ospf {
prefix ospf;
}
import ietf-interfaces {
prefix if;
}
import ietf-routing-types {
prefix rt-types;
}

organization "KernelKit";
contact "[email protected]";
description "Deviations and augments for ietf-routing and ietf-ospf.";

revision 2024-11-15 {
description "Fix pyang linter errors and warnings:
- Drop OSPF database deviations, already deviated earlier
- Drop unused imports";
reference "internal";
}
revision 2024-10-01 {
description "Remove possibility to have loopack in multiple areas.";
reference "internal";
Expand Down Expand Up @@ -457,26 +457,6 @@ module infix-routing {
deviate not-supported;
}

/* OSPF database */
deviation "/rt:routing/rt:control-plane-protocols/rt:control-plane-protocol/ospf:ospf/ospf:database/ospf:as-scope-lsa-type/ospf:as-scope-lsas/ospf:as-scope-lsa/ospf:version/ospf:ospfv3" {
deviate not-supported;
}
deviation "/rt:routing/rt:control-plane-protocols/rt:control-plane-protocol/ospf:ospf/ospf:database/ospf:as-scope-lsa-type/ospf:as-scope-lsas/ospf:as-scope-lsa/ospf:version/ospf:ospfv2/ospf:ospfv2/ospf:body/ospf:opaque" {
deviate not-supported;
}
deviation "/rt:routing/rt:control-plane-protocols/rt:control-plane-protocol/ospf:ospf/ospf:database/ospf:as-scope-lsa-type/ospf:as-scope-lsas/ospf:as-scope-lsa/ospf:version/ospf:ospfv2/ospf:ospfv2/ospf:body/ospf:external" {
deviate not-supported;
}
deviation "/rt:routing/rt:control-plane-protocols/rt:control-plane-protocol/ospf:ospf/ospf:database/ospf:as-scope-lsa-type/ospf:as-scope-lsas/ospf:as-scope-lsa/ospf:version/ospf:ospfv2/ospf:ospfv2/ospf:body/ospf:summary" {
deviate not-supported;
}
deviation "/rt:routing/rt:control-plane-protocols/rt:control-plane-protocol/ospf:ospf/ospf:database/ospf:as-scope-lsa-type/ospf:as-scope-lsas/ospf:as-scope-lsa/ospf:version/ospf:ospfv2/ospf:ospfv2/ospf:body/ospf:router" {
deviate not-supported;
}
deviation "/rt:routing/rt:control-plane-protocols/rt:control-plane-protocol/ospf:ospf/ospf:database/ospf:as-scope-lsa-type/ospf:as-scope-lsas/ospf:as-scope-lsa/ospf:version/ospf:ospfv2/ospf:ospfv2/ospf:header" {
deviate not-supported;
}

/* OSPF RPCs */
deviation "/ospf:clear-neighbor" {
deviate not-supported;
Expand Down
File renamed without changes.

0 comments on commit 6c1b989

Please sign in to comment.