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

Cross-Module deviation statement doesn't properly check module prefixes? #214

Open
wenovus opened this issue Oct 1, 2021 · 1 comment
Open

Comments

@wenovus
Copy link
Collaborator

wenovus commented Oct 1, 2021

Need to write a reproducing YANG file first, but the reported problem is that a deviation without the proper prefix for an element in the path still compiles but shouldn't.

@wenovus wenovus self-assigned this Oct 1, 2021
@wenovus
Copy link
Collaborator Author

wenovus commented Feb 10, 2022

So I think so this is a low-priority bug. The issue occurs when the prefix after the first element is specified incorrectly, as in this test case in TestDeviation. Given this is a minor bug that pyang already detects, I think it won't have too much of an impact.

                desc: "deviation not supported across modules but prefix unspecified",                                                                                                                                                                                                                                                                     
                inFiles: map[string]string{                                                                                                                                                                                                                                                                                                                
                        "source": `                                                                                                                                                                                                                                                                                                                        
                                module source {                                                                                                                                                                                                                                                                                                            
                                        prefix "s";                                                                                                                                                                                                                                                                                                        
                                        namespace "urn:s";                                                                                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                                                                                                           
                                        container c { leaf a { type string; } }                                                                                                                                                                                                                                                                            
                                        leaf b { type string; }                                                                                                                                                                                                                                                                                            
                                }`,                                                                                                                                                                                                                                                                                                                        
                        "deviation": `                                                                                                                                                                                                                                                                                                                     
                                        module deviation {                                                                                                                                                                                                                                                                                                 
                                                prefix "d";                                                                                                                                                                                                                                                                                                
                                                namespace "urn:d";                                                                                                                                                                                                                                                                                         
                                                                                                                                                                                                                                                                                                                                                           
                                                import source { prefix s; }                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                           
                                                deviation /s:c/z:a {                                                                                                                                                                                                                                                                                       
                                                        deviate not-supported;                                                                                                                                                                                                                                                                             
                                                }                                                                                                                                                                                                                                                                                                          
                                        }`,                                                                                                                                                                                                                                                                                                                
                },                                                                                                                                                                                                                                                                                                                                         

@wenovus wenovus removed their assignment Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant