-
Notifications
You must be signed in to change notification settings - Fork 90
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
Update routeros.py #138
Update routeros.py #138
Conversation
Adjust the terminal detection line to support forward slashes in device hostnames (connections fail without clear reason otherwise)
Thanks for this fix! This also needs a changelog fragment. BTW, we started moving the routeros plugins and modules to a new repository yesterday: https://github.com/ansible-collections/community.routeros Since we plan to backport bugfixes to this repository anyway, I guess we can also merge this PR here and then 'foreport' it to the new repo. I hope that's OK for everyone. CC @heuels |
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.
Thanks for the contribution!
@svliron once the changelog fragment is there (and looks good), I'll merge. |
@svliron are you sure that hostname syntax convention allows to use slashes in hostnames? |
@igloo777 which "hostname syntax convention" do you mean? Could you please elaborate? RouterOS seems to accept hostnames which include slashes (otherwise we wouldn't have this issue/PR). |
For the changelog fragments, what do you all think of: bugfixes:
- "routeros terminal plugin - allow slashes in hostnames for terminal detection. Without this, slashes in hostnames will result in connection timeouts (https://github.com/ansible-collections/community.network/pull/138)." |
https://tools.ietf.org/html/rfc952 RouterOS may accept any symbols in identity (I want emoji). But then RouterOS should have dedicated hostname option in config. |
IMHo, better to break an execution with "rfc952 breaking symbol symbol found in hostname, fix your hostname" message in err output. |
Feel free to create a PR to implement that. But be warned, it's not trivial, since you have to modify code in another collection for that (https://github.com/ansible-collections/ansible.netcommon/blob/c2aa1d6981d9dd5d6e824fdfae2df7c5eef46f50/plugins/connection/network_cli.py#L996-L1050). |
Once CI passes, I'll merge as this clearly improves the current situation. I'll also fore-port it to the community.routeros repo. |
* Update routeros.py Adjust the terminal detection line to support forward slashes in device hostnames (connections fail without clear reason otherwise) * Add changelog fragment. Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 3f3e0d0)
* Update routeros.py Adjust the terminal detection line to support forward slashes in device hostnames (connections fail without clear reason otherwise) * Add changelog fragment. Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 3f3e0d0) Fore-ported from ansible-collections/community.network#138.
* Update routeros.py Adjust the terminal detection line to support forward slashes in device hostnames (connections fail without clear reason otherwise) * Add changelog fragment. Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 3f3e0d0) Co-authored-by: svliron <[email protected]>
* Update routeros.py Adjust the terminal detection line to support forward slashes in device hostnames (connections fail without clear reason otherwise) * Add changelog fragment. Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 3f3e0d0) Fore-ported from ansible-collections/community.network#138.
Adjust the terminal detection line to support forward slashes in device hostnames (connections fail without clear reason otherwise)
SUMMARY
My RouterOS units have forward slashes in their system identities. The way the regex is structured prevents terminal detection from succeeding in this case, and devices will fail silently. The regex is still probably overly strict, but it fixed my problem.
ISSUE TYPE