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

Rewrite of template logic #20

Closed
Lochnair opened this issue May 15, 2020 · 5 comments
Closed

Rewrite of template logic #20

Lochnair opened this issue May 15, 2020 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Lochnair
Copy link
Collaborator

Copying this from the old issue.

IMO it's about time for a rewrite of all the logic in the templates. Or rather ripping all the logic out of the templates (except syntax validation etc.).

As things currently stand the templates are becoming harder and harder to maintain every time we try to add features or fix bugs, because more logic are added to an already convoluted template system.

Personally I'd like to see everything moved out to an external script in much the same way the VyOS guys have done, avoiding a mess in the templates.

VyOS' Python wrapper for cli-shell-api partly works on EdgeOS, because the cli_shell_api version on EdgeOS doesn't include isMulti, isTag and the likes.

I have managed to get it completely working by building a patched cli_shell_api binary that includes them. I guess we could ship that, and let it live side-by-side with the stock one.

This would also be a good opportunity to do breaking changes such as #92.

I'd love to hear what people think about this and any suggestions you might have.

@FossoresLP
Copy link
Collaborator

I think this is a good idea but I do not have enough experience with Vyatta so it would be great if someone could create a PR.
@jollyjinx If you get started on this (as you mentioned in #14) please let us know here.
Anyone else is also welcome to help out so marking this help-wanted.

@FossoresLP FossoresLP added enhancement New feature or request help wanted Extra attention is needed labels May 16, 2020
@acejacek
Copy link
Contributor

I know very little about this, but having extra free time due to current circumstances, I'd love to learn new stuff. Just help me to kick start.

@jollyjinx
Copy link

I haven't started yet as I wanted to understand the template system a bit more. What helped me was to add print statements to the node.def files so I could see what is happening when. As I don't know how to get the template system into debug mode.
I've created a branch for just switching over to get debug messages. I then have a crude command line that does install the current local version to the router:
scp -r wireguard router:/tmp/wireguard; ssh router 'cd /opt/vyatta/share/vyatta-cfg/templates/interfaces;sudo mv -f wireguard /tmp/wg.old.$(date +'%H%M%S') ; sudo mv /tmp/wireguard /opt/vyatta/share/vyatta-cfg/templates/interfaces/wireguard
and do my commands on the router console then while looking at the output of /tmp/wg.log

If someone knows a way to get the whole template system into debug mode - that would help a lot.

@whiskerz007
Copy link
Contributor

whiskerz007 commented Nov 7, 2020

I just submitted a pull request to address this concern.

@FossoresLP
Copy link
Collaborator

Fixed by #55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Development

No branches or pull requests

5 participants