summaryrefslogtreecommitdiff
path: root/lib/ansible/module_utils/shell.py
Commit message (Collapse)AuthorAgeFilesLines
* fixs command dict to be sent to connection socket (#21713)Peter Sprygada2017-02-221-1/+1
| | | | | There as an invalid key in the command dict that would cause failure using prompts. This changes the key from response to answer which is what is expected by network_cli
* fixes minor issues with shell (#21039)Peter Sprygada2017-02-041-5/+6
| | | | * adds sendonly to command dict * fixes setting timeout param
* bug fixes for shell exec command (#20988)Peter Sprygada2017-02-021-49/+25
| | | | | * fixes up eos_local to call appropriate method * fixes up ios_cli to call appropriate method * moves json conversion to eos
* fixes handle_prompt in shell module (#20982)Peter Sprygada2017-02-021-13/+19
| | | | * transforms command objects to dict * transforms string commands to dict
* fixes exec_command in shell (#20948)Peter Sprygada2017-02-011-2/+12
| | | transforms command to dict for processing by instance of Shell
* moves the module utils network cli transport into a separate module (#20921)Peter Sprygada2017-02-011-41/+51
| | | | This move will allow for the cli transport to go through a deprecation process as we transition to network_cli plugin
* Assorted python3 fixes for network code. (#18777)Nathaniel Case2016-12-151-5/+5
|
* expose timeout param to socket (#18632)Peter Sprygada2016-11-281-16/+30
| | | | | The timeout param was exposed to the socket connection but was not enforced for commands. This update will now cause a command to timeout based on the module parameter.
* Fix for whitespace padding on JSON responsesNathaniel Case2016-11-221-1/+1
| | | | Fixes #17825, closes #17829
* fixes issue with setting the terminal length (pager) in vyos (#18546)Peter Sprygada2016-11-211-1/+2
| | | | `set terminal length 0` actually sets `VYATTA_PAGER=cat` `set terminal length [some number]` actually sets `stty length [some number]`
* Exception.message gone in 3.x (#18221)Nathaniel Case2016-10-281-4/+4
| | | * Exception.message gone in 3.x
* Cleanup StringIO import for module_utils/shell.pyMichael Scherer2016-10-281-5/+1
|
* adds additional exception handling in open() (#18003)Peter Sprygada2016-10-131-0/+2
| | | | The open() method will now catch a socket.timeout exception and raise a ShellError.
* Cleanup openswitchNathaniel Case2016-09-121-1/+1
| | | | | Also bump get_config in vyos, to pick up the addition of **kwargs Closes #17415
* Vyos cleanupNathaniel Case2016-09-121-1/+1
| | | Addresses #17416
* minor optimizations and clean up in shell.pyPeter Sprygada2016-09-041-19/+15
| | | | | * cleans up method signatures * drops checking for Command properties that no longer exist
* catches timeout error when connecting to remote host in shellPeter Sprygada2016-08-281-0/+5
| | | | | This will now catch a timeout error when shell attempts to open the connection to the remove device and gracefully raise it as a ShellError
* Provide options for SSH key checking (#15736)Nathaniel Case2016-08-241-7/+20
| | | | * Provide options for SSH key checking
* Remove abort_config and commit_configNathaniel Case2016-08-231-0/+13
| | | | | Also move unimplemented command methods to CliBase, where they can be overridden as needed
* Common CliBase run_commands implementationNathaniel Case2016-08-221-0/+2
|
* replaces NetCli in network with CliBase in shellPeter Sprygada2016-08-201-40/+81
| | | | | This doesn't change any of the behavior but moves NetCli to CliBase and relcates the object to the shell module
* Find places where ziploader is used and change them to ansiballz so that ↵Toshio Kuratomi2016-07-211-1/+1
| | | | people aren't confused when they google for information.information (#16715)
* Network Module: EOS (#16158)Nathaniel Case2016-06-201-0/+5
| | | | | | | | | | | | | | | * add new module network * move EOS to NetworkModule * shell.py Python 3.x compatibility * implements the Command class through the connection for eos This implements a new Command class that specifies the cli command and output format. This removes the need to batch commands through the connection * initial add of netcmd module
* fixes issues with authenticating using ssh-agent for ios devicesPeter Sprygada2016-06-061-0/+3
| | | | | | | Exception was raised when trying to use ssh-agent for authentication to ios devices. This fix enables ssh-agent and enable use of password protected ssh keys. There is one additional fix to capture authentication exceptions nicely.
* Merge pull request #15727 from privateip/shell_modulePeter Sprygada2016-05-181-6/+9
|\ | | | | handle name resolution errors more gracefully from shell.py
| * handle name resolution errors more gracefully from shell.pyPeter Sprygada2016-05-041-6/+9
| | | | | | | | | | This change will catch socket.gaierror exceptions from shell.py and return a more friendly message to the user
* | Port shell snippet to python3/2.4 compatible syntax (#15874)Michael Scherer2016-05-161-1/+3
|/
* Allow timeout to be configurable (#14973)Patrick Ogenstad2016-04-141-2/+1
|
* ZiploaderToshio Kuratomi2016-04-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Ziploader proof of concept (jimi-c) * Cleanups to proof of concept ziploader branch: * python3 compatible base64 encoding * zipfile compression (still need to enable toggling this off for systems without zlib support in python) * Allow non-wildcard imports (still need to make this recusrsive so that we can have module_utils code that imports other module_utils code.) * Better tracebacks: module filename is kept and module_utils directory is kept so that tracebacks show the real filenames that the errors appear in. * Make sure we import modules that are used into the module_utils files that they are used in. * Set ansible version in a more pythonic way for ziploader than we were doing in module replacer * Make it possible to set the module compression as an inventory var This may be necessary on systems where python has been compiled without zlib compression. * Refactoring of module_common code: * module replacer only replaces values that make sense for that type of file (example: don't attempt to replace python imports if we're in a powershell module). * Implement configurable shebang support for ziploader wrapper * Implement client-side constants (for SELINUX_SPECIAL_FS and SYSLOG) via environment variable. * Remove strip_comments param as we're never going to use it (ruins line numbering) * Don't repeat ourselves about detecting REPLACER * Add an easy way to debug * Port test-module to the ziploader-aware modify_module() * strip comments and blank lines from the wrapper so we send less over the wire. * Comments cleanup * Remember to output write the module line itself in powershell modules * for line in lines strips the newlines so we have to add them back in
* adds additional details in exception handling in shell shared modulePeter Sprygada2016-04-041-1/+1
|
* feature to allow prompts to be configured at instatiationPeter Sprygada2016-03-131-7/+8
| | | | | | | | This commit adds a new feature to allow implementations of shell to specify the command prompt regexp to be used. It allows adds a new kwarg at instantiation to kick the remote device with a carriage return. By default the kickstart flag is true but can be disabled by passing kickstart=False.
* Merge pull request #14906 from devananda/fix-shell-for-junosPeter Sprygada2016-03-111-0/+1
|\ | | | | Send empty command before recv
| * Send empty command before recvDevananda van der Veen2016-03-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | On some switches, starting an SSH connection and immediately calling recv() will result in a connection timeout. The switch requires some input on the channel before it provides any prompt. As such, this patch sends an empty command immediately upon connection, triggering the switch to send a prompt which the shell can then interpret. Signed-off-by: Devananda van der Veen <devananda.vdv@gmail.com>
* | bugfix for shared module shell.pyPeter Sprygada2016-03-101-21/+0
|/ | | | | removes get_cli_connection function which was left over from a refactor but was no longer in use
* Use io.StringIO and io.BytesIO instead of StringIO.StringIO for compat with py3Toshio Kuratomi2016-02-261-1/+5
|
* Avoids authentication failed exception if user has private rsa keys under .sshogenstad2016-02-231-3/+3
|
* minor bug fixes and updates to shellPeter Sprygada2016-02-111-1/+7
|
* adds private key file support to shell shared modulePeter Sprygada2016-01-191-4/+7
| | | | | | This commit provides an argument to provide a path to the private key file. This will allow paramiko to use the key file as opposed to only username / password combinations for CLI connections.
* adds shared module shell for creating cli based transportsPeter Sprygada2016-01-081-0/+193
This commit add a new shared module shell that is used to build connections to network devices that operate in a CLI environment. This commit supercedes the issh.py and cli.py commits and removes them from module_utils.