Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if choice is declared with multiple elements or leaf-list with in a case scope , addition or updation is not happening as expected #327

Closed
gopiKrishnaPuligundla opened this issue Apr 29, 2022 · 3 comments

Comments

@gopiKrishnaPuligundla
Copy link

Scenario 1 :

Container ex_container {
choice ex_choice {
case a {
leaf b {
type uint32;
}
leaf c {
type uint32;
}
}
case source_dest_network {
leaf d {
type uint32;
}
}
if in a case 2 leafs are there , we can only configure one leaf ,
in above example if we configure b and try to configure c , b gets deleted and vice verse

scenario 2 :

Container ex_container {
choice ex_choice {
case acl_id {
leaf-list acl-list {
type uint32;
}
}
case source_dest_network {
leaf-list source-network {
type string;
}
}
leaf-list destination-network {
type string;
}
}
}
}
In above example , if we configure act-list 1 and if we try to add act-list 2 , clixon infra is triggering delete request for acl-list 1.
Ideally it shouldn’t delete act-list 1 instead just add acl-list 2 as it is of same case .

@olofhagsand
Copy link
Member

I see some more issues with the choice/case code that does not follwo RFC 7950 Sec 7.9:

If a request creates a node from a case, the server will delete any existing nodes that are defined in
other cases inside the choice.

These are also fixed as part of the patch of fixing merge properly.
Note that you may need to apply "Merge" instead of "replace/set" to add items to an existing case.

olofhagsand added a commit that referenced this issue Apr 29, 2022
…h in a case scope , addition or updation is not happening as expected](#327)

  * This includes several choice/case adjustments to follow RFC 7950 Sec 7.9 better
@olofhagsand
Copy link
Member

Please verify patch and close issue if verified

@gopiKrishnaPuligundla
Copy link
Author

Hi Olof , issues mentioned were fixed, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants