-
Notifications
You must be signed in to change notification settings - Fork 24
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
Ordering dictionary does not yield expected results when using multiple startswith entries #14
Comments
The behavior: Recommendation:
The default ordering weight is 500. This should result in:
Which is what you likely want. As your use of HConfig grows, you will find it necessary to have fix up methods that fire after running and startup config is loaded to make various corrections/normalizations. The same is true for post remediation command generation. In this case, you are looking to clean up unused objects; an ACL in this case. We have unused object removal methods in our internal project. We will discuss open sourcing them. If you really really really need conditional parent ordering, I suggest creating a remediation config fix up method that conditionally sets the order weight prior to returning the textual remediation config. We haven't found a need to do this yet. Actions:
|
What is a use case for not giving the parent line the same weight as the child line(s)? |
Ordering is required at different levels. Consider the below example:
|
This is how I would have thought to implement that:
The child line cannot be written without the parent line coming first, so it seems more intuitive to me that parent inherits the lowest weight from all of its children. |
When considering this, think of the remediation config as whole. There are cases where the remediation will be hundreds(we've had cases in the thousands) of lines long going down several levels of hierarchy. The ordering ruleset needs to be able to set ordering on these levels of hierarchy independent of one another. Setting the ordering weight of a child of |
I do not get a match under
ordering
when I use a nested lineage (interface subcommands); but it works when I only match the parent line.Here is my config data:
Running:
Intended:
Here is a non-working
ordering
Options:
Result:
I tested without using a nested lineage and I get the expected results
Options:
Result:
The text was updated successfully, but these errors were encountered: