kernelkit / infix

Linux :yellow_heart: NETCONF = Infix
https://kernelkit.github.io/
GNU General Public License v2.0
45 stars 11 forks source link

UNIX `copy` command to load/save/check .cfg files #373

Open troglobit opened 3 months ago

troglobit commented 3 months ago

Suggestion to add a command line tool, similar to sysrepocfg, but one that knows more about Infix.

troglobit commented 3 months ago

@wkz + @mattiaswal RFC on an idea I that's been floating around for a while. The most important feature in my mind right now is the validation, so that users can verify the new configuration would actually work.

wkz commented 3 months ago

I like it!

Some initial thoughts:

troglobit commented 3 months ago

Interesting, maybe as a general rule of thumb, use the same names as we use today in the CLI admin-exec context, in this case copy? Would mean less retraining of personnel and possibly less support issues.

For the validation, my idea was to connect to sysrepo, import the file to candidate, and run the validation/check we do today from the CLI. That way we don't need to first extract all modules and enabled features using sysrepoctl to feed into yanglint.

A validation could then look like:

admin@example:~$ copy --dry-run some-file.cfg running-config
Incompatible source (some-file.cfg) with system YANG models:
<detailed error from libyang via sysrepo>
wkz commented 3 months ago

Yes, that is way better than my suggestion! :+1: