NixOS/nixops — pull request #124 by aszlig (2013-08-26 09:10:48+00:00)
Title: Refactor SSH stuff into using paramiko.

I know, this adds an additional dependency, but using `Popen` to execute OpenSSH directly, really is painful in [a](https://github.com/NixOS/nixops/blob/9893dc751d49f83f37eb4240ed9d5633f38c0b7f/nixops/backends/__init__.py#L368) [lot](https://github.com/aszlig/nixops/commit/ce0d4e66d963885afb7a03a05c7410e85afa566f) [of](https://github.com/aszlig/nixops/commit/9cca2d8d795f18c7c6490ba642ed335a770b5025) [cases](https://github.com/NixOS/nixops/blob/9893dc751d49f83f37eb4240ed9d5633f38c0b7f/nixops/backends/__init__.py#L39-L42) where we have to implement things using a bunch of temporary files and dirty workarounds. [Paramiko](https://github.com/paramiko/paramiko) on the other side is a pure Python implementation and it's way easier to handle keys, passwords, file uploads, persistent sessions (not to mention [host keys](https://github.com/NixOS/nixops/blob/d1cf2c065d726e14e6da192741e8aae780812a9a/nixops/known_hosts.py)) and other stuff without the need to create temporary files or do really ugly and error-prone workarounds.

The only thing I've stumbled on so far which can't be used directly is `nix-copy-closure`, but even there, we could use `nix-store --export/--import` directly and connect the `file` instances.