Skip to content

Commit

Permalink
scripts/nixops: Switch to using SSH.invoke_shell.
Browse files Browse the repository at this point in the history
We now should have a ssh subcommand which works the same way as the
ssh-for-each subcommand, except that it doesn't rely on a SSH master
socket to be present.

This not only has the benefits of making the codebase more DRY but also
things like ssh into a machine that's in rescue mode now work properly.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
  • Loading branch information
aszlig committed Oct 29, 2015
1 parent 6781c0a commit e856016
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions scripts/nixops
Expand Up @@ -504,11 +504,7 @@ def op_ssh():
(username, machine) = parse_machine(args.machine)
m = depl.machines.get(machine)
if not m: raise Exception("unknown machine ‘{0}’".format(machine))
ssh_name = m.get_ssh_name()
if args.debug:
print >> sys.stderr, "connecting to {0}...".format(ssh_name)
res = subprocess.call(["ssh", username + "@" + ssh_name] + m.get_ssh_flags() + args.args)
sys.exit(res)
sys.exit(m.ssh.invoke_shell(['-l', username] + args.args))


def op_ssh_for_each():
Expand Down

0 comments on commit e856016

Please sign in to comment.