[OPNFLWPLUG-1103] Openflow-Action list needs a key? Created: 04/Sep/20  Updated: 16/Dec/20  Resolved: 16/Dec/20

Status: Resolved
Project: OpenFlowPlugin
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: High
Reporter: Eric Sender Assignee: dheenadayalan b
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:
  • CentOS 7
  • pyang 2.3.2

 


Issue Links:
Relates
relates to OPNFLWPLUG-1104 Installing Opendaylight-Flow-Types in... Open

 Description   

I am using `pyang` to validate a yang module which I am basing off of openflow. In the process of building it out, I am validating my yang through pyang and I am noticing this error:

 

$ pyang my.yang
openflow-instruction@2013-07-31.yang:21: error: the list at "openflow-instruction@2013-07-31.yang:21 (at openflow-action@2015-02-03.yang:32)" needs at least one key because it is used as config

 

When looking at the source code for openflow-action I see:

 grouping actions-grouping {
   list action {
      uses action-grouping;
      leaf experimenter-id {
        type oft:experimenter-id;
     }
}

So it is missing a `key`. I can't tell if this is a bug with openflow-action or if pyang is running in some ultra strict mode, but does anyone have insight on this?



 Comments   
Comment by Eric Sender [ 10/Sep/20 ]

A couple github tickets which I am running in parallel confirm that ODL has syntax errors

https://github.com/mbj4668/pyang/issues/674

https://github.com/CESNET/libyang/issues/1192#issuecomment-690026975

 

Essentially I modified:

  • opendaylight-port-types@2013-09-25.yang
  • openflow-action@2015-02-03.yang{{}}

 

And my diff:

 

 diff --git a/box/rmbn-yang/src/main/yang/opendaylight-port-types@2013-09-25.yang b/box/rmbn-yang/src/main/yang/opendaylight-port-types@2013-09-25.yang
{{ index fa6e1fc..53f00c5 100644}}
{{ — a/box/rmbn-yang/src/main/yang/opendaylight-port-types@2013-09-25.yang}}
{{ +++ b/box/rmbn-yang/src/main/yang/opendaylight-port-types@2013-09-25.yang}}
{{ @@ -193,6 +193,7 @@ module opendaylight-port-types {}}
{{ augment "/multipart:multipart-reply/multipart:multipart-reply-body" {}}
{{ case multipart-reply-port-desc {}}
{{ list ports}}{{

{ + key "name"; uses flow-capable-port; }

}}}
{{ diff --git a/box/rmbn-yang/src/main/yang/openflow-action@2015-02-03.yang b/box/rmbn-yang/src/main/yang/openflow-action@2015-02-03.yang}}
{{ index d2ae42f..25abff6 100644}}
{{ — a/box/rmbn-yang/src/main/yang/openflow-action@2015-02-03.yang}}
{{ +++ b/box/rmbn-yang/src/main/yang/openflow-action@2015-02-03.yang}}
{{ @@ -30,6 +30,7 @@}}grouping actions-grouping {
{{ list action {}}
{{ + key "experimenter-id";}}
{{ uses action-grouping;}}
{{ leaf experimenter-id {}}
{{ type oft:experimenter-id;}}
{{ diff --git a/box/rmbn-yang/src/main/yang/openflow-instruction@2013-07-31.yang b/box/rmbn-yang/src/main/yang/openflow-instruction@2013-07-31.yang}}
{{ index b9e515b..1dfdd14 100644}}
{{ — a/box/rmbn-yang/src/main/yang/openflow-instruction@2013-07-31.yang}}
{{ +++ b/box/rmbn-yang/src/main/yang/openflow-instruction@2013-07-31.yang}}
{{ @@ -23,6 +23,7 @@}}grouping instructions-grouping {
{{ list instruction {}}
{{ + key "experimenter-id";}}
{{ config false;}}
{{ uses instruction-grouping;}}
{{ leaf experimenter-id {}}

 

Comment by Robert Varga [ 16/Dec/20 ]

can you create a separate issue for this, with the attached patch, please?

Comment by Robert Varga [ 16/Dec/20 ]

The pyang error is expected: OpenDaylight's LogicalDatastoreType.CONFIGURATION is more flexible.

It comes from pyang's strict reading of RFC6020/7950 when 'config' is involved – it effectively expresses what is a datastore policy for those nodes. RFC8342 fixes this and pyang needs to adapt.

Generated at Wed Feb 07 20:34:12 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.