blob: 429a261f1ac97d08787b99063acdf6a17b27622a [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
11local_env = locals()
12if machines:
13 local_env['host'] = hosts.SSHHost(machines[0])
14
15try:
16 import IPython
17 ipshell = IPython.Shell.IPShellEmbed(argv=[])
18 ipshell()
19except ImportError:
20 import code
21 code.interact("Autoserv console", raw_input, local_env)