-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
tools: fix reload interface deletion #16723
base: master
Are you sure you want to change the base?
Conversation
Could you please drop the merge commit? |
@@ -1740,10 +1740,12 @@ def compare_context_objects(newconf, running): | |||
delete_bgpd = True | |||
lines_to_del.append((running_ctx_keys, None)) | |||
|
|||
# We cannot do 'no interface' or 'no vrf' in FRR, and so deal with it | |||
elif running_ctx_keys[0].startswith("interface"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If nothing is present under interface
context, then it's not printed at all. I'm trying to understand what problem are we solving here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the confusion, I've updated the description I hope it's more clear now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please put the description into the commit message itself. No-one is going to look at the actual PR in a couple of years. They'll look at the commit via git show...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, shouldn't we check for len(running_ctx_keys) == 1
in this case too? It might be also interface blabla vrf ...
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should not make a difference in my opinion.
Because now it matches everything starting with interface
which is under the "global" configuration context.
For example it will match:
interface foo
But it will also match:
interface foo vrf bar
But it will not match something like:
some context
interface foo
25c40ea
to
8c23b84
Compare
8c23b84
to
6c3b44a
Compare
Could you show how it looks when doing |
Sure here is the output of the lines that should be deleted before the change. The line with
And here it is with the change:
You see before it was removing line by line under interface context. Now it just deletes the interface as a whole which allows deleting the interface out of |
Closes #15081 |
Could you fix the styling? |
The frr-reload script currently deletes configurations line-by-line under an interface context, if the interface was removed. This approach fails when the interface has already been removed from the system. This change enables whole interface removal using a single command (no interface <interface-name>), simplifying the reload process and reducing reload errors. Signed-off-by: Julian Klaiber <[email protected]>
6c3b44a
to
0513050
Compare
@ton31337 any updates on this PR? Please let me know if you need some changes or information from me. |
@donaldsharp any objections here? |
Current Behavior
frr-reload.py
script does not allow removing an entire interface context in one step. Instead, it attempts to delete each configuration line individually under the interface context.Specific Issue:
Impact of the Issue:
Example:
When the interface was removed from the
frr.conf
and then the reload script is executed the following error is triggered:Proposed Solution
no interface <interface-name>
).Advantages of the Solution: