From 69342de1844ed0d8a0e53f8f04c10e0725c44ce1 Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Thu, 22 Mar 2018 12:48:19 +0100 Subject: v3po: fix issues found by pyang Change-Id: Icbe45830641ba89a1e136401528acdb2b836d12e Signed-off-by: Marek Gradzki --- v3po/api/src/main/yang/pbb-types@2016-12-14.yang | 16 ++------ .../main/yang/subinterface-span@2017-05-10.yang | 44 -------------------- .../main/yang/subinterface-span@2017-06-07.yang | 48 ++++++++++++++++++++++ .../yang/unnumbered-interfaces@2018-01-03.yang | 20 ++++----- v3po/api/src/main/yang/v3po@2017-06-07.yang | 35 ++++++++-------- v3po/api/src/main/yang/vpp-pbb@2016-12-14.yang | 8 +++- v3po/api/src/main/yang/vpp-vlan@2018-03-19.yang | 38 ++++++++--------- 7 files changed, 103 insertions(+), 106 deletions(-) delete mode 100644 v3po/api/src/main/yang/subinterface-span@2017-05-10.yang create mode 100644 v3po/api/src/main/yang/subinterface-span@2017-06-07.yang diff --git a/v3po/api/src/main/yang/pbb-types@2016-12-14.yang b/v3po/api/src/main/yang/pbb-types@2016-12-14.yang index 8c3aad41a..cb9fbb1bb 100644 --- a/v3po/api/src/main/yang/pbb-types@2016-12-14.yang +++ b/v3po/api/src/main/yang/pbb-types@2016-12-14.yang @@ -3,23 +3,15 @@ module pbb-types { namespace "urn:opendaylight:params:xml:ns:yang:pbb-types"; prefix "pbb-types"; - description "Common types used for defining Pbb based subinterfaces"; - - revision "2016-12-14" { - description - "Initial revision."; - } - import ietf-yang-types { prefix yang; } - import ietf-interfaces { - prefix if; - } + description "Common types used for defining Pbb based subinterfaces"; - import yang-ext { - prefix "ext"; + revision "2016-12-14" { + description + "Initial revision."; } typedef operation { diff --git a/v3po/api/src/main/yang/subinterface-span@2017-05-10.yang b/v3po/api/src/main/yang/subinterface-span@2017-05-10.yang deleted file mode 100644 index 9308c5d4a..000000000 --- a/v3po/api/src/main/yang/subinterface-span@2017-05-10.yang +++ /dev/null @@ -1,44 +0,0 @@ -module subinterface-span { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:subinterface-span"; - prefix "subif-span"; - - revision "2017-05-10" { - description - "Initialial revision that adds support for mirroring interfaces on subinterfaces. - Vpp implementation allows/implements only two cases: - - Src: interface |Dst: interface - covered in v3po.yang - - Src: interface |Dst: subinterface - covered by this model"; - } - - revision "2017-06-07" { - description "Eliminated config leafrefs in operational tree"; - } - - import v3po { - prefix "v3po"; - } - - import vpp-vlan { - prefix "vpp-vlan"; - } - - import yang-ext { - prefix "ext"; - } - - augment /if:interfaces/if:interface/vpp-vlan:sub-interfaces/vpp-vlan:sub-interface { - ext:augment-identifier "vpp-subinterface-span-augmentation"; - - container span { - uses v3po:span-attributes; - } - } - - augment /if:interfaces-state/if:interface/vpp-vlan:sub-interfaces/vpp-vlan:sub-interface { - ext:augment-identifier "vpp-subinterface-span-state-augmentation"; - container span-state { - uses v3po:span-state-attributes; - } - } -} \ No newline at end of file diff --git a/v3po/api/src/main/yang/subinterface-span@2017-06-07.yang b/v3po/api/src/main/yang/subinterface-span@2017-06-07.yang new file mode 100644 index 000000000..22f8ee1b3 --- /dev/null +++ b/v3po/api/src/main/yang/subinterface-span@2017-06-07.yang @@ -0,0 +1,48 @@ +module subinterface-span { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:subinterface-span"; + prefix "subif-span"; + + import ietf-interfaces { + prefix "if"; + } + + import vpp-vlan { + prefix "vpp-vlan"; + } + + import yang-ext { + prefix "ext"; + } + + import v3po { + prefix "v3po"; + } + + revision "2017-06-07" { + description "Eliminated config leafrefs in operational tree"; + } + + revision "2017-05-10" { + description + "Initialial revision that adds support for mirroring interfaces on subinterfaces. + Vpp implementation allows/implements only two cases: + - Src: interface |Dst: interface - covered in v3po.yang + - Src: interface |Dst: subinterface - covered by this model"; + } + + augment /if:interfaces/if:interface/vpp-vlan:sub-interfaces/vpp-vlan:sub-interface { + ext:augment-identifier "vpp-subinterface-span-augmentation"; + + container span { + uses v3po:span-attributes; + } + } + + augment /if:interfaces-state/if:interface/vpp-vlan:sub-interfaces/vpp-vlan:sub-interface { + ext:augment-identifier "vpp-subinterface-span-state-augmentation"; + container span-state { + uses v3po:span-state-attributes; + } + } +} \ No newline at end of file diff --git a/v3po/api/src/main/yang/unnumbered-interfaces@2018-01-03.yang b/v3po/api/src/main/yang/unnumbered-interfaces@2018-01-03.yang index 391e05363..515573e8c 100644 --- a/v3po/api/src/main/yang/unnumbered-interfaces@2018-01-03.yang +++ b/v3po/api/src/main/yang/unnumbered-interfaces@2018-01-03.yang @@ -3,16 +3,6 @@ module unnumbered-interfaces { namespace "urn:opendaylight:params:xml:ns:yang:unnumbered:interfaces"; prefix "uni"; - revision "2018-01-03" { - description - "Use if:interface-ref for name of the interface which provides IP."; - } - - revision "2017-05-10" { - description - "Initialial revision"; - } - import ietf-interfaces { prefix "if"; } @@ -25,6 +15,16 @@ module unnumbered-interfaces { prefix "ext"; } + revision "2018-01-03" { + description + "Use if:interface-ref for name of the interface which provides IP."; + } + + revision "2017-05-10" { + description + "Initialial revision"; + } + grouping unnumbered-config-attributes { container unnumbered { presence "Sets interface as unnumbered"; diff --git a/v3po/api/src/main/yang/v3po@2017-06-07.yang b/v3po/api/src/main/yang/v3po@2017-06-07.yang index 58ef0685a..e05c804b6 100644 --- a/v3po/api/src/main/yang/v3po@2017-06-07.yang +++ b/v3po/api/src/main/yang/v3po@2017-06-07.yang @@ -3,6 +3,22 @@ module v3po { namespace "urn:opendaylight:params:xml:ns:yang:v3po"; prefix "v3po"; + import iana-if-type { + prefix "ianaift"; + } + import ietf-interfaces { + prefix "if"; + } + import ietf-yang-types { + prefix "yang"; + } + import ietf-inet-types { + prefix "inet"; + } + import yang-ext { + prefix "ext"; + } + revision "2017-06-07" { description "Eliminated config leafrefs in operational tree"; } @@ -30,25 +46,6 @@ module v3po { description "Initial revision of v3po model"; } - import iana-if-type { - prefix "ianaift"; - } - import ietf-interfaces { - prefix "if"; - } - import ietf-yang-types { - prefix "yang"; - } - import ietf-inet-types { - prefix "inet"; - } - import ietf-ip { - prefix "ip"; - } - import yang-ext { - prefix "ext"; - } - typedef bridge-domain-ref { type leafref { path "/bridge-domains/bridge-domain/name"; diff --git a/v3po/api/src/main/yang/vpp-pbb@2016-12-14.yang b/v3po/api/src/main/yang/vpp-pbb@2016-12-14.yang index d3ca160ce..7301b86a9 100644 --- a/v3po/api/src/main/yang/vpp-pbb@2016-12-14.yang +++ b/v3po/api/src/main/yang/vpp-pbb@2016-12-14.yang @@ -3,8 +3,8 @@ module vpp-pbb { namespace "urn:opendaylight:params:xml:ns:yang:vpp-pbb"; prefix "vpp-pbb"; - revision "2016-12-14" { - description "Initial revision of pbb model"; + import ietf-interfaces { + prefix "if"; } import pbb-types { @@ -15,6 +15,10 @@ module vpp-pbb { prefix "ext"; } + revision "2016-12-14" { + description "Initial revision of pbb model"; + } + augment /if:interfaces/if:interface { ext:augment-identifier "pbb-rewrite-interface-augmentation"; container pbb-rewrite{ diff --git a/v3po/api/src/main/yang/vpp-vlan@2018-03-19.yang b/v3po/api/src/main/yang/vpp-vlan@2018-03-19.yang index a919580b9..53d657e29 100644 --- a/v3po/api/src/main/yang/vpp-vlan@2018-03-19.yang +++ b/v3po/api/src/main/yang/vpp-vlan@2018-03-19.yang @@ -3,6 +3,25 @@ module vpp-vlan { namespace "urn:opendaylight:params:xml:ns:yang:vpp:vlan"; prefix "vpp-vlan"; + import ietf-interfaces { + prefix "if"; + } + import ietf-inet-types { + prefix inet; + } + import ietf-yang-types { + prefix "yang"; + } + import yang-ext { + prefix "ext"; + } + import dot1q-types { + prefix dot1q; + } + import v3po { + prefix v3po; + } + revision "2018-03-19" { description "Prefix invalid 802dot1q and 802dot1ad identifiers with underscore."; } @@ -34,25 +53,6 @@ module vpp-vlan { Reuses some concepts from draft-wilton-netmod-intf-vlan-yang-02 model."; } - import ietf-interfaces { - prefix "if"; - } - import ietf-inet-types { - prefix inet; - } - import ietf-yang-types { - prefix "yang"; - } - import yang-ext { - prefix "ext"; - } - import dot1q-types { - prefix dot1q; - } - import v3po { - prefix v3po; - } - typedef sub-interface-status { type enumeration { enum "up"; -- cgit 1.2.3-korg