summaryrefslogtreecommitdiff
path: root/lib/ansible/plugins/terminal/ios.py
Commit message (Collapse)AuthorAgeFilesLines
* Add ios changes for Python3 (#24601)Ganesh Nalawade2017-05-171-2/+2
| | | | | | | | | | | | | * Add ios changes for Python3 Make `execute_command` arguments and its return value complaint to PY3 changes made in PR #24431 pep8 fixes * Fix CI issues * Fix review comment
* Fix for persistent connection plugin on Python3 (#24431)Toshio Kuratomi2017-05-121-25/+26
| | | | | | | | | | | | | | | | | | | Fix for persistent connection plugin on Python3. Note that fixes are also needed to each terminal plugin. This PR only fixes the ios terminal (as proof that this approach is workable.) Future PRs can address the other terminal types. * On Python3, pickle needs to work with byte strings, not text strings. * Set the pickle protocol version to 0 because we're using a pty to feed data to the connection plugin. A pty can't have control characters. So we have to send ascii only. That means only using protocol=0 for pickling the data. * ansible-connection isn't being used with py3 in the bug but it needs several changes to work with python3. * In python3, closing the pty too early causes no data to be sent. So leave stdin open until after we finish with the ansible-connection process. * Fix typo using traceback.format_exc() * Cleanup unnecessary StringIO, BytesIO, and to_bytes calls * Modify the network_cli and terminal plugins for py3 compat. Lots of mixing of text and byte strings that needs to be straightened out to be compatible with python3 * Documentation for the bytes<=>text strategy for terminal plugins * Update unittests for more bytes-oriented internals Fixes #24355
* Set terminal width for network *_command modules to avoid paging (#23728)Trishna Guha2017-04-251-1/+2
| | | Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
* Remove catch-all regex on IOS terminal plugin (#23858)Ricardo Carrillo Cruz2017-04-211-1/+1
| | | | | | | | | | We have a list of specific messages that we scree-scrape and flag them as legit errors. However, we also have a catch-all regex that matches everything starting with %. That can cause issues on commands that return lines with that character, like for example the 'crypto key generate'. Fixes #23770
* clean up of terminal plugins (#21549)Peter Sprygada2017-02-171-4/+2
| | | | | | * removes unneeded supports_multiplexing var * refactors terminal_prompts_re to terminal_stdout_re * refactors terminal_errors_re to terminal_stderr_re * updates network_cli unit test cases
* removes network os guess static method (#19467)Peter Sprygada2016-12-191-6/+0
| | | | | | For devices that do not support mutliplexing, we cannot automatically determine the network os. This removes the os guess static method from the terminal plugin. For this devices, the network_os value must be configured
* adds feature to try to auto determine network_os (#18674)Peter Sprygada2016-11-301-0/+6
| | | | | This updates the network_cli connection plugin to attempt to automatically determine the remote device os. The device network os discovery can be overridden by setting the ansible_network_os value.
* adds two new plugins that use ansible-connection for persistence (#18572)Peter Sprygada2016-11-281-0/+82
* adds new connection plugin `network_cli` which builds on paramiko * adds new plugin `terminal` used for manipulating network_cli terminals * adds new field to play_context `network_os` settable as ansible_network_os This commit adds the plugins necesary to establish a persistent cli connection to network devices of ssh. It builds on the paramiko connection plugin to create a shell environment that will persistent through ansible-connection. The `newtork_cli` plugin then uses the network_os in the instance of PlayContext to load the appropriate network OS environment plugin for handling opening and closing of shells as well as privilege escalation.