cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
844
Views
0
Helpful
2
Replies

NSO: Delete operation with when condition

KMawal
Level 1
Level 1

Hello,

we use nso-5.3 in a local installation.

We have this part in a yang file:

    container mvr {

        description

            "mvr";

        leaf status  {

            type  cml_data_types:CML_ENABLE_DISABLE_T;

            default "disable";

            description "Use this attribute to enable/disable MVR.";

        } // END of status definition.

 

        list mvrVlan {

            when "../status = 'enable'";

            key "vlanId";

            description

                "mvrVlan";

            leaf vlanId  {

                type  cml_data_types:CML_INT32_T {

                     range "1..4094";

                }

                description "Specify the VlanId for MVR";

            } // END of vlanId definition.

 

            leaf-list groupAddr  {

                type  cml_data_types:CML_IPV4_ADDR_T;

                description "Specify Group IP address for VlanId to be added to MVR.";

            } // END of groupAddr definition.

        } // End of mvrVlan-list

    } // END of mvr-container definition.

 

 

In case of a "delete" operation we receive this RPC from NSO:

 

      <mvr xmlns="http://....">

        <mvrVlan xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"

                 nc:operation="delete">

          <vlanId>240</vlanId>

        </mvrVlan>

        <status xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"

                nc:operation="delete"/>

      </mvr>

 

This causes some problems because as a first operation on the server

"status" gets deleted, so it falls back to default which is "disable"

and then the “mvrVlan” gets deleted internally and is no longer valid.

A subsequent try to access and delete leaf vlanId results in an error.

 

Why does NSO send a delete for "status" and the depending "mvrVlan"?

In my understanding a delete for "status" would be sufficient.

(note: We checked that NSO obey the “when” condition, e.g. it is not possible

to create “mvrVlan/vlanId” if "status" is in default.)

Is there a way to tell NSO to send delete for "status" only?

 

I'd be very happy for any hint! 

2 Replies 2

vleijon
Cisco Employee
Cisco Employee
First of all, I am guessing this is a device model and you are talking about the NSO netconf communication towards a device implementing this device model, right?

If that is the case, I am not sure. NSO will internally derive the deletion of the list of course, which is correct.

But, looking into RFC7950 we have:


Modification requests for nodes tagged with "when", and the "when"

condition evaluates to "false". In this case, the server MUST

reply with an "unknown-element" in the .

So, this looks very suspicious, I’d recommend raising a ticket about this to have someone take a proper look.

Thanks for fast answer!

And yes, you are right with your assumptions, I'm sorry I did not put it in the first mail: the XML snippet is from a yang file for a device model and NSO communication is going towards the device which implements that model. NED for NSO was built taking into account the device model yang file(s).

Unfortunately, the server flags another error. But in the end, error statement does not help no matter what cause is reported.

So, I'd follow your recommendation and raise a ticket.