mbligh | b3e4e3f | 2007-10-19 06:25:18 +0000 | [diff] [blame] | 1 | # autoserv_console.srv - gives you an interactive interpreter within an autoserv |
| 2 | # control file. If you pass "-m hostname", an SSHHost will be available under |
| 3 | # the variable "host". |
| 4 | |
| 5 | # If you install IPython (http://ipython.scipy.org/, Ubuntu package "ipython"), |
| 6 | # you'll get a snazzy IPython console with readline and completion and all that. |
| 7 | # Otherwise you'll get a simple console without any of that. |
| 8 | |
| 9 | # -Steve Howard (showard@google.com) |
| 10 | |
mbligh | b3e4e3f | 2007-10-19 06:25:18 +0000 | [diff] [blame] | 11 | if machines: |
mbligh | 781f523 | 2007-11-22 00:34:33 +0000 | [diff] [blame] | 12 | host = hosts.SSHHost(machines[0]) |
mbligh | b3e4e3f | 2007-10-19 06:25:18 +0000 | [diff] [blame] | 13 | |
| 14 | try: |
mbligh | 781f523 | 2007-11-22 00:34:33 +0000 | [diff] [blame] | 15 | import IPython |
| 16 | ipshell = IPython.Shell.IPShellEmbed(argv=[]) |
| 17 | ipshell() |
mbligh | b3e4e3f | 2007-10-19 06:25:18 +0000 | [diff] [blame] | 18 | except ImportError: |
mbligh | 781f523 | 2007-11-22 00:34:33 +0000 | [diff] [blame] | 19 | import code |
| 20 | code.interact("Autoserv console", raw_input, locals()) |