From 6c1b989b85bce058f2023a7e885acbc2ab972d71 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Fri, 15 Nov 2024 12:03:26 +0100 Subject: [PATCH] confd: fix pyang linter errors 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 --- src/confd/yang/confd.inc | 4 +-- src/confd/yang/containers.inc | 2 +- src/confd/yang/infix-containers.yang | 4 --- src/confd/yang/infix-if-bridge.yang | 10 +++--- ...6.yang => infix-if-bridge@2024-11-15.yang} | 0 src/confd/yang/infix-if-container.yang | 26 +++++++++++---- ...ang => infix-if-container@2024-11-15.yang} | 0 src/confd/yang/infix-interfaces.yang | 18 ++++------- ....yang => infix-interfaces@2024-11-15.yang} | 0 src/confd/yang/infix-routing.yang | 32 ++++--------------- ...-01.yang => infix-routing@2024-11-15.yang} | 0 11 files changed, 38 insertions(+), 58 deletions(-) rename src/confd/yang/{infix-if-bridge@2024-08-26.yang => infix-if-bridge@2024-11-15.yang} (100%) rename src/confd/yang/{infix-if-container@2024-10-29.yang => infix-if-container@2024-11-15.yang} (100%) rename src/confd/yang/{infix-interfaces@2024-11-12.yang => infix-interfaces@2024-11-15.yang} (100%) rename src/confd/yang/{infix-routing@2024-10-01.yang => infix-routing@2024-11-15.yang} (100%) diff --git a/src/confd/yang/confd.inc b/src/confd/yang/confd.inc index cb7eee3da..84ee4ae89 100644 --- a/src/confd/yang/confd.inc +++ b/src/confd/yang/confd.inc @@ -27,7 +27,7 @@ MODULES=( "ieee802-dot1q-types@2022-10-29.yang" "infix-ip@2024-09-16.yang" "infix-if-type@2024-10-13.yang" - "infix-routing@2024-10-01.yang" + "infix-routing@2024-11-15.yang" "ieee802-dot1ab-lldp@2022-03-15.yang" "infix-lldp@2023-08-23.yang" "infix-dhcp-client@2024-09-20.yang" @@ -37,7 +37,7 @@ MODULES=( "ieee802-ethernet-interface@2019-06-21.yang" "infix-ethernet-interface@2024-02-27.yang" "infix-factory-default@2023-06-28.yang" - "infix-interfaces@2024-11-12.yang -e vlan-filtering" + "infix-interfaces@2024-11-15.yang -e vlan-filtering" # from rousette "ietf-restconf@2017-01-26.yang" diff --git a/src/confd/yang/containers.inc b/src/confd/yang/containers.inc index 8d69b6625..0a5d891dc 100644 --- a/src/confd/yang/containers.inc +++ b/src/confd/yang/containers.inc @@ -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" "infix-containers@2024-11-15.yang" ) diff --git a/src/confd/yang/infix-containers.yang b/src/confd/yang/infix-containers.yang index 87673d8b8..4d46b08d6 100644 --- a/src/confd/yang/infix-containers.yang +++ b/src/confd/yang/infix-containers.yang @@ -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; } diff --git a/src/confd/yang/infix-if-bridge.yang b/src/confd/yang/infix-if-bridge.yang index 74806d3fc..c85d41952 100644 --- a/src/confd/yang/infix-if-bridge.yang +++ b/src/confd/yang/infix-if-bridge.yang @@ -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; } @@ -15,9 +12,6 @@ submodule infix-if-bridge { import ietf-interfaces { prefix if; } - import ietf-inet-types { - prefix inet; - } import ietf-ip { prefix ip; } @@ -32,6 +26,10 @@ submodule infix-if-bridge { contact "kernelkit@googlegroups.com"; 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. diff --git a/src/confd/yang/infix-if-bridge@2024-08-26.yang b/src/confd/yang/infix-if-bridge@2024-11-15.yang similarity index 100% rename from src/confd/yang/infix-if-bridge@2024-08-26.yang rename to src/confd/yang/infix-if-bridge@2024-11-15.yang diff --git a/src/confd/yang/infix-if-container.yang b/src/confd/yang/infix-if-container.yang index 425156736..f496aa4ff 100644 --- a/src/confd/yang/infix-if-container.yang +++ b/src/confd/yang/infix-if-container.yang @@ -13,9 +13,6 @@ submodule infix-if-container { import ietf-ip { prefix ip; } - import infix-if-type { - prefix infixift; - } organization "KernelKit"; contact "kernelkit@googlegroups.com"; @@ -23,6 +20,13 @@ submodule infix-if-container { 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"; @@ -32,6 +36,14 @@ submodule infix-if-container { reference "internal"; } + /* + * Features + */ + + feature containers { + description "Containers is an optional build-time feature in Infix."; + } + /* * Identities */ @@ -76,6 +88,9 @@ 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'"; @@ -83,10 +98,7 @@ submodule infix-if-container { 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 { diff --git a/src/confd/yang/infix-if-container@2024-10-29.yang b/src/confd/yang/infix-if-container@2024-11-15.yang similarity index 100% rename from src/confd/yang/infix-if-container@2024-10-29.yang rename to src/confd/yang/infix-if-container@2024-11-15.yang diff --git a/src/confd/yang/infix-interfaces.yang b/src/confd/yang/infix-interfaces.yang index 1afb2721c..a550fdf16 100644 --- a/src/confd/yang/infix-interfaces.yang +++ b/src/confd/yang/infix-interfaces.yang @@ -4,7 +4,7 @@ module infix-interfaces { prefix infix-if; import infix-if-type { - prefix infixift; + prefix infix-ift; } import ietf-interfaces { prefix if; @@ -23,8 +23,10 @@ module infix-interfaces { contact "kernelkit@googlegroups.com"; 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"; } @@ -74,14 +76,6 @@ module infix-interfaces { reference "internal"; } - /* - * Features - */ - - feature containers { - description "Containers is an optional build-time feature in Infix."; - } - /* * Data Nodes */ @@ -89,7 +83,7 @@ module infix-interfaces { deviation "/if:interfaces/if:interface/if:type" { deviate replace { type identityref { - base infixift:infix-interface-type; + base infix-ift:infix-interface-type; } } } diff --git a/src/confd/yang/infix-interfaces@2024-11-12.yang b/src/confd/yang/infix-interfaces@2024-11-15.yang similarity index 100% rename from src/confd/yang/infix-interfaces@2024-11-12.yang rename to src/confd/yang/infix-interfaces@2024-11-15.yang diff --git a/src/confd/yang/infix-routing.yang b/src/confd/yang/infix-routing.yang index 59d7bcb69..fa17daeb3 100644 --- a/src/confd/yang/infix-routing.yang +++ b/src/confd/yang/infix-routing.yang @@ -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 "kernelkit@googlegroups.com"; 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"; @@ -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; diff --git a/src/confd/yang/infix-routing@2024-10-01.yang b/src/confd/yang/infix-routing@2024-11-15.yang similarity index 100% rename from src/confd/yang/infix-routing@2024-10-01.yang rename to src/confd/yang/infix-routing@2024-11-15.yang