Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Added 'newline_char' option to specify the character to be sent after… #52753
… each command
Added 'exit_cmd' option to sign out of the device
I am working on a device that does not use the UNIX convention where the linefeed character is the line terminator; instead it uses CR. (The LF character acts as an "abort action", similar to ^U on a UNIX system, where all characters typed into the terminal line left of the cursor are deleted.) I need a way to specify the newline character.
In addition, the unit does not recognize 'exit\r' as a valid command to terminate the session; only 'logout' is accepted.
Before the change, here is what I would see in debug output when I connect to the device. The device would backspace over my line, and the change would not take:
After I made the changes in telnet.py, and updated my playbook to include newline_char: "\r" in my job step, I now see better results, and the server's name has been changed:
Please be gentle, this is my first time ever forking a project, contributing a fix, creating a pull request, etc etc. Thanks.