Branch: refs/heads/master
  Home:   https://github.com/NixOS/nixops
  Commit: c9dc09db8df82ecc4cf2e68132684d889afe17bf
      
https://github.com/NixOS/nixops/commit/c9dc09db8df82ecc4cf2e68132684d889afe17bf
  Author: aszlig <[email protected]>
  Date:   2015-10-30 (Fri, 30 Oct 2015)

  Changed paths:
    M nixops/ssh_util.py

  Log Message:
  -----------
  ssh_util: Add 'user' keyword arg to run_command().

So far we're using -l in op_ssh(), but unfortunately that's not working
for the SSHMaster.

This keyword arg now ensures that the master gets a proper target with
the specified username, so we no longer need to pass -l.

Signed-off-by: aszlig <[email protected]>


  Commit: c6d91102899f1a74eb9584161a5e3bc5b7b62ceb
      
https://github.com/NixOS/nixops/commit/c6d91102899f1a74eb9584161a5e3bc5b7b62ceb
  Author: aszlig <[email protected]>
  Date:   2015-10-30 (Fri, 30 Oct 2015)

  Changed paths:
    M nixops/ssh_util.py
    A tests/unit/test_split_openssh_args.py

  Log Message:
  -----------
  ssh_util: Add new split_openssh_args() method.

This is useful if we want to distinguish from a bunch of SSH flags
whether the argument is a normal OpenSSH flag or whether it's an actual
command that's passed to OpenSSH.

We do this by simply recursing through the list of flags and eat up all
flags and non-flags until we either get a command or a "--" in which
case we treat everything afterwards as a command.

Note that this is specifically for use in NixOps, because OpenSSH not
only has a command argument but also a target argument which we don't
need so we don't handle it.

Signed-off-by: aszlig <[email protected]>


  Commit: ffbbe130071b34939da9093882cfcdbe70aac3d8
      
https://github.com/NixOS/nixops/commit/ffbbe130071b34939da9093882cfcdbe70aac3d8
  Author: aszlig <[email protected]>
  Date:   2015-10-30 (Fri, 30 Oct 2015)

  Changed paths:
    M scripts/nixops

  Log Message:
  -----------
  scripts/nixos: Fix handling SSH args in do_ssh.

Regression introduced by da1a81a82936cdc63749b2950674daadf7a1d278.

This really doesn't pass the username to the SSH master process but just
the ssh call that's using the master, which then will obviously fail.

The last two commits were a preparation for improving this, so on one
side we have the user keyword argument, which passes the user name
directly as user@machine to the SSH master process.

On the other side we now have split_openssh_args(), which we can use to
distinguish between a SSH command and a SSH flag. The reason this is
necessary is that we don't want to add the command to the SSH master
process but of course we want to have flags appended to the master
process.

While this certainly increases complexity, but if we really want to pass
SSH options verbatim, we don't have any other option except adding them
like this:

nixops ssh --ssh-flags="-i /foo/bar" my_shiny_command

However, this would introduce a backwards-incompatibility, because SSH
flags passed verbatim will then throw an error.

And I've stated the reason why we can't avoid starting an SSH master
process in da1a81a82936cdc63749b2950674daadf7a1d278 already.

On the upside we gain one more thing (except fixing the functionality)
and it should be mostly backwards-compatible:

We can finally do the following: nixops ssh shiny_machine ls -l

The reason for this is that we now use argparse.REMAINDER, so we don't
get nasty quirks and escaping goofs if "--" is used.

And similar to argparse.REMAINDER is the actual OpenSSH argument parsing
where after the last non-flag the target and the command are used
without trying to parse additional arguments.

The reason why it's only "mostly" backwards-compatible is that something
like this:

nixops ssh foo -- -v ls -l

Has now to be called like this:

nixops ssh foo -v ls -l

Signed-off-by: aszlig <[email protected]>


  Commit: 593a91c6384361164a46a94300b5a633c4f3c990
      
https://github.com/NixOS/nixops/commit/593a91c6384361164a46a94300b5a633c4f3c990
  Author: aszlig <[email protected]>
  Date:   2015-10-30 (Fri, 30 Oct 2015)

  Changed paths:
    M doc/manual/nixops.xml

  Log Message:
  -----------
  doc: Fix note about OpenSSH options.

We no longer need -- to pass flags to OpenSSH options.

Signed-off-by: aszlig <[email protected]>


  Commit: 018bca51aad96203113173c27c113896c040751c
      
https://github.com/NixOS/nixops/commit/018bca51aad96203113173c27c113896c040751c
  Author: aszlig <[email protected]>
  Date:   2015-10-30 (Fri, 30 Oct 2015)

  Changed paths:
    M tests/none-backend.nix

  Log Message:
  -----------
  tests/none: Fix use of "nixops ssh".

We no longer need to use "--" to pass SSH options (in this case "-v").

Signed-off-by: aszlig <[email protected]>


Compare: https://github.com/NixOS/nixops/compare/c59254d497f9...018bca51aad9
_______________________________________________
nix-commits mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-commits

Reply via email to