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
Add option to enable Genie fuzzy syntax matching #2800
Comments
So Genie tries to guess based on weighting what the abbreviated command represents? Should we just enable this by default? Are there any downsides to do doing this? I am not seeing much downside in just enabling this. |
I took every command in their parsers.json file and ran them through the ======================================================= With regards to using full syntax commands (where there are no variables), I was unable to detect a change. Every parser result returned matched exactly the command that I sent in. This is to be expected as the exact syntax matching is weighed higher than partial syntax or variables. ======================================================= With regards to commands with variables in them, I substituted every variable with the word "variable" (via For example:
However, when changing fuzzy to However, was when setting fuzzy to
Again, this could be because of the way I am brute force testing, so not 100% sure. ======================================================= Lastly, I took every command that didn't have a variable in it again and removed the last letter of each word in the command to simulate partial syntax commands at every word. When I ran them through with When I ran it with So, we have false positives...but when looking over the false positives all of them were because that last letter of the syntax is indeed needed. For example:
And lastly, as I stated earlier it did produce a single false negative:
======================================================= So, in conclusion: setting fuzzy to |
When using the
.send_command()
method withuse_genie=True
the command syntax being sent can sometimes be abbreviated (i.e.sh ip int
vsshow ip interface
), but not always (sh ip int br
fails). After digging through the Genie code I was able to determine that it was due to the way they score/weigh each word in the command. I initially created an issue on their repo thinking this was a bug, but realized afterward that this was because I was calling their._fuzzy_search_command()
function withfuzzy=False
as this is the default and there is no way in Netmiko to enable this option.It would be nice to have an option on the
.send_command()
method that can be passed to Genie to enable fuzzy syntax matching.The text was updated successfully, but these errors were encountered: