-
Notifications
You must be signed in to change notification settings - Fork 70
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
fix(eos_config): Handle multiline config for RCF "code unit" #526
base: main
Are you sure you want to change the base?
fix(eos_config): Handle multiline config for RCF "code unit" #526
Conversation
12cea9c
to
4527ab1
Compare
@@ -153,7 +153,7 @@ def get_session_config( | |||
cmd = line["command"] | |||
if cmd == "end": | |||
continue | |||
if cmd.startswith("banner") or multiline: | |||
if cmd.startswith(("banner", "code unit")) or multiline: |
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.
Starting with code unit
will not capture all the RCF multiline code units. We also have the singular unnamed code unit whose EOS config cmd is simply code
instead of code unit FOO
.
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.
Since there is no context awareness here, we would then catch all lines starting with code no matter where in the CLI they are placed. Can you guarantee that we do not have code anywhere else? or maybe code is on a line by itself?
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.
I can't guarantee that we do not have "code" in any other CLI command. In the absense of mode/context awareness, I think checking for "code" on a line by itself is probably the best option.
SUMMARY
Fix error when configuring router control-functions by handling them as multiline inputs similar to how "banner" is handled.
Also added testing of multi line config. Using "banner" for this test, since RCF requires a much newer EOS version.
ISSUE TYPE
COMPONENT NAME
eos_config
ADDITIONAL INFORMATION
Fix handling of multi line config sections starting with "code unit" similar to how "banner" commands are handles.
Example of configuration failing today:
Without this fix, the module returns an error: