blob: 50bb62a08cb9aae7e800b3c3493cec27c9ca6523 [file] [log] [blame]
mblighb3e4e3f2007-10-19 06:25:18 +00001# 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
mblighb3e4e3f2007-10-19 06:25:18 +000011if machines:
mbligh781f5232007-11-22 00:34:33 +000012 host = hosts.SSHHost(machines[0])
mblighb3e4e3f2007-10-19 06:25:18 +000013
14try:
mbligh781f5232007-11-22 00:34:33 +000015 import IPython
16 ipshell = IPython.Shell.IPShellEmbed(argv=[])
17 ipshell()
mblighb3e4e3f2007-10-19 06:25:18 +000018except ImportError:
mbligh781f5232007-11-22 00:34:33 +000019 import code
20 code.interact("Autoserv console", raw_input, locals())