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

Nested YANG choice does not work #342

Closed
olofhagsand opened this issue Jul 5, 2022 · 0 comments
Closed

Nested YANG choice does not work #342

olofhagsand opened this issue Jul 5, 2022 · 0 comments

Comments

@olofhagsand
Copy link
Member

Choice within choice does not work as expected, ie in the below yang, if topA is first configured, and then something in topB, the topA config remains, but should not:
cli example:

olof@alarik /> show configuration 
clixon-example:c {
    A1x ff;
    Ay foo;
}         
olof@alarik /> set c B1x ff            
olof@alarik /> show configuration 
clixon-example:c {
    B1x ff;
    Ay foo;  <---------- Should be removed
}

yang:

    container c {
	choice top{
	    case topA {
		choice A{
		    leaf A1x{
			type string;
		    }
		    leaf A2x{
			type string;
		    }
		}
		leaf Ay{
		    type string;
		}
	    }
	    case topB{
		choice B{
		    case B1{
			leaf B1x{
			    type string;
			}
		    }
		    case B2{
			leaf B2x{
			    type string;
			}
		    }
		}
		leaf By{
		    type string;
		}
	    }
	}
    }

Thanks: @mgsmith1000

@olofhagsand olofhagsand added the bug label Jul 5, 2022
olofhagsand added a commit that referenced this issue Jul 14, 2022
Previous fix only for some sub-cases. New fix should work for all reecursive cases
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

1 participant