1. Ian Bicking
  2. silverlining


qwertyface  committed 7b27fea

Add a --interactive flag to the run command, for running interactive commands.

This causes the -t flag to be passed into ssh, which forces pseudo-tty
allocation. This allows commands such as database shells and ipython
to be run.

  • Participants
  • Parent commits 582c5a2
  • Branches default

Comments (0)

Files changed (2)

File silverlining/commands/run.py

View file
         tmp_location = match.group(1)
         tmp_location = 'NONE'
+    ssh_args = ['-t'] if args.interactive else []
     stdout, stderr, returncode = ssh(
         args.user, config.node_hostname,
-         args.location, tmp_location, args.script] + translated_args)
+         args.location, tmp_location, args.script] + translated_args,
+        ssh_args=ssh_args)
     return returncode

File silverlining/runner.py

View file
     help="Answer yes to any questions")
+    '-i', '--interactive',
+    action='store_true',
+    help=("Tells ssh to force pseudo-tty allocation.  Useful when what you're"
+          " running is a shell of some sort"))
 #add_verbose(parser_run, add_log=True)