-
Notifications
You must be signed in to change notification settings - Fork 77
fix(eos_config): Handle multiline config for RCF "code unit" #526
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
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
| 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.
|
Hi @rohitthakur2590 , did you have a chance to take a look on this PR? And/or @ClausHolbechArista @keon-arista is there any other option to use RCF? |
Hi @somakelemen, can you expand on what you mean by "other option to use RCF"? Are you looking for alternative configuration workflows with ansible, without it, or something entirely different? |
Yes, I am looking for an alternative workaround until this PR will be approved/merged and ready to configure RCF with ansible. |
I am not very familiar with Ansible, so I will let Claus address if there are any workarounds using Ansible. If you are comfortable staging the RCF code unit as a text file on the box, you can use the "pull unit " command to pull the contents of a file into a RCF code unit. That will avoid having to specify the RCF code unit contents as a multiline input. Outside Ansible, you are free to use any other mechanism of configuring EOS (native CLI, EAPI, etc.) to configure RCF. |
|
@somakelemen I do not have a workaround, but this works well if you use CloudVision for deploying the configs (also from Ansible). This PR stalled because I discovered that netcommon components also silently remove lines with a single }. While trying to fix that I found more components that modifies the CLI commands, so it required too many changes for what I could do. |
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: