1. Ian Bicking
  2. silverlining

Commits

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)
     else:
         tmp_location = 'NONE'
+    ssh_args = ['-t'] if args.interactive else []
     stdout, stderr, returncode = ssh(
         args.user, config.node_hostname,
         ['/usr/local/share/silverlining/mgr-scripts/run-command.py',
-         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
     action='store_true',
     help="Answer yes to any questions")
 
+parser_run.add_argument(
+    '-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)
 
 parser_run.add_argument(