Create an interactive session and execute the commands passed as "cmds" and return all output :param cmds: a list of commands to run :param timeout: timeout in seconds :returns: (output, returned) contains both sys.stdout and sys.stderr logs
(cmds, **kargs)
| 180 | |
| 181 | |
| 182 | def autorun_get_interactive_live_session(cmds, **kargs): |
| 183 | # type: (str, **Any) -> Tuple[str, Any] |
| 184 | """Create an interactive session and execute the |
| 185 | commands passed as "cmds" and return all output |
| 186 | |
| 187 | :param cmds: a list of commands to run |
| 188 | :param timeout: timeout in seconds |
| 189 | :returns: (output, returned) contains both sys.stdout and sys.stderr logs |
| 190 | """ |
| 191 | sstdout, sstderr = sys.stdout, sys.stderr |
| 192 | sw = StringWriter(debug=sstdout) |
| 193 | try: |
| 194 | try: |
| 195 | sys.stdout = sys.stderr = sw |
| 196 | res = autorun_commands_timeout(cmds, **kargs) |
| 197 | except StopAutorun as e: |
| 198 | e.code_run = sw.s |
| 199 | raise |
| 200 | finally: |
| 201 | sys.stdout, sys.stderr = sstdout, sstderr |
| 202 | return sw.s, res |
| 203 | |
| 204 | |
| 205 | def autorun_get_text_interactive_session(cmds, **kargs): |
no test coverage detected
searching dependent graphs…