08-18-2020 09:41 AM - edited 08-18-2020 09:42 AM
I am looking to use 'genie diff' to find discrepancies in my production environment, gathered with 'genie learn config', against our golden configs. Problem I am running into is I want to exclude variable keys such as 'interface *'. I tried using manual exclusion on the diff but couldn't get that to exclude any key, no matter what I referenced. Ideally I would like to find a way to edit the exclude list in the 'genie learn config', much the same way that other ops use. OSPF ops for example:
"_exclude": [
"age",
"uptime",
"last_change",
"cksum",
"seq",
"dead_timer",
"hello_timer",
"checksum",
"seq_num",
"statistics",
"lsas",
"last_state_change",
"bdr_ip_addr",
"dr_ip_addr",
"state",
"bdr_router_id",
"dr_router_id",
"area_scope_lsa_cksum_sum"
],
Any assistance is appreciated.
08-19-2020 12:11 AM
Have you tried this option:
(genie) bash-4.1$ genie diff --help Usage: genie diff [commands] [options] Example ------- genie diff file1 file2 genie diff dir1 dir2 genie diff dir1 dir2 --exclude "age" genie diff dir1 dir2 --no-default-exclusion --exclude "age" "uptime" Description: Diff two feature or parser snapshots saved to file or directory Default exclusion can be found at $VIRTUAL_ENV/genie_yamls/pts_datafile.yaml Diff Options: [file or directory] file/directory of pre=snapshot [file or directory] file/directory of post-snapshot --output OUTPUT Which directory to store logs, by default it will be current directory (Optional) --exclude [EXCLUDE [EXCLUDE ...]] Keys to exclude when saving the Feature (Optional) --no-default-exclusion Do not use the default exclude keys (Optional)
Stay safe,
Sergiu
08-20-2020 09:27 AM
Thanks for the reply. Yes, I have tried that and found that I can exclude specific interfaces, "interface Bundle-Ether31" for example. However, I would like to exclude all interfaces. I did try regex to try to filter on all interfaces but this didn't work. Do you know how to exclude with wildcard filters? Also, it would be great to just use the default exclusion file to add exclusion keys to but I do not even see the "config" ops listed under my pts_datafile.yaml. I do see the osfp ops:
ospf:
source:
pkg: genie.libs.ops
class: ospf.ospf.Ospf
devices: ['uut']
exclude: []
Question is how does this correspond to the default exclusions used on the command when I learn devices ospf parameters. They are listed in the top post.
Thanks!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide