Statistics
| Branch: | Tag: | Revision:

root / lib / ssh.py @ c124045f

History | View | Annotate | Download (7.2 kB)

# Date Author Comment
5bbd3f7f 07/07/2009 03:51 pm Michael Hanselmann

Fix some typos

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

a162cf5b 02/03/2009 12:55 pm Iustin Pop

ssh: more details on failure

In case we fail without output from the ssh command, we should at least
add the exit code or any other failure reason to the error message, and
log it and the cmdline used to the node daemon log.

Reviewed-by: imsnah

a3f9f296 02/03/2009 12:45 pm Guido Trotter

Give a sane permission to the known_host file

Reviewed-by: iustinp

9c034cbe 12/14/2008 02:04 pm Iustin Pop

lib/ssh.py: import the logging module

This only means most of our error paths in this module were not working
(and generating exceptions).

Reviewed-by: amishchenko

bf75f132 12/14/2008 02:04 pm Iustin Pop

SshRunner: add docstring for _BuildSshOptions

Reviewed-by: amishchenko

c41eea6e 12/11/2008 07:13 pm Iustin Pop

Fix epydoc format warnings

This patch should fix all outstanding epydoc parsing errors; as such, we
switch epydoc into verbose mode so that any new errors will be visible.

Reviewed-by: imsnah

23828f1c 10/20/2008 03:50 pm Iustin Pop

Convert ssh.py to use the logging module

Reviewed-by: imsnah

56bece1f 10/06/2008 02:48 pm Iustin Pop

Change SshRunner usage

Currently the SshRunner uses a SimpleConfigReader instance, however this
is not best. We change it to use the cluster name directly (and its
constructor now takes this as parameter, instead of SCR), and its
callers are change to pass the name directly....

7688d0d3 10/01/2008 08:35 pm Michael Hanselmann

Convert ssh.py

Get rid of ssconf and convert to configuration instead.

Reviewed-by: iustinp

652d6694 08/15/2008 11:47 am Michael Hanselmann

SshRunner: Add parameter to always accept peer's SSH key

This will be used to add nodes without user interaction, specifically
in QA tests.

Reviewed-by: ultrotter

f6d9f4c3 08/15/2008 11:44 am Michael Hanselmann

Move SSH option building into a function

I'm going to add another option and it would make maintaining
them in constants even more complicated.

Reviewed-by: ultrotter

54ab6aec 08/15/2008 11:44 am Michael Hanselmann

SshRunner.Run: Pass all arguments to BuildCmd

This patch changes SshRunner.Run to pass all arguments to
SshRunner.BuildCmd. They had the same arguments before
and should stay that way. This change makes it easier
to add new or change existing arguments.
...

51144e33 08/13/2008 03:55 pm Michael Hanselmann

Fix adding pristine nodes

If a node hasn't been part of the cluster before being added it'll not
have the cluster's SSH key. This patch makes sure to accept those by
not aliasing the machine name to the cluster name.

Reviewed-by: ultrotter

1d544ba3 04/01/2008 07:52 pm Michael Hanselmann

Check whether path is valid before accessing it

Reviewed-by: ultrotter

fff33d70 03/18/2008 03:04 pm Michael Hanselmann

Use constants for “ssh” and “scp” binaries instead of magic values

Reviewed-by: ultrotter

1ff08570 03/18/2008 03:03 pm Michael Hanselmann

Use new cluster alias in known_hosts file

Reviewed-by: ultrotter

8f07f831 03/18/2008 03:03 pm Michael Hanselmann

Add “tty” parameter to SshRunner.BuildCmd

This allows callers to allocate a pseudo-TTY easily.

Reviewed-by: ultrotter

bf3d57b8 03/18/2008 03:03 pm Michael Hanselmann

Order SSH options alphabetically

Reviewed-by: ultrotter

c92b310a 03/18/2008 03:02 pm Michael Hanselmann

Move SSH functions into a class

This renames some functions and does some minor codestyle cleanup.

Reviewed-by: ultrotter

75a5f456 03/18/2008 03:02 pm Michael Hanselmann

Add function to write cluster SSH key to known_hosts file

The whole Ganeti cluster has a single SSH key. Its fingerprint is
written to Ganeti's known_hosts file, together with an alias. This
allows us to always use that alias instead of the real hostname,...

aa4260ca 10/19/2007 02:49 pm Iustin Pop

Some tiny style fixes

Reviewed-by: imsnah

70d9e3d8 10/16/2007 11:28 am Iustin Pop

Replace more ssh paths with proper constants

The node's ssh keys filenames are now provided as constants; this should
allow easier customization.

Also, the user's ssh key computing has been abstracted into ssh.py

Reviewed-by: imsnah

2f31098c 10/10/2007 01:00 pm Iustin Pop

Remove the shebang from modules

Since modules are not directly executables, remove the shebang from
them. This helps with lintian warnings.

Also make the autogenerated _autoconf.py contain two comment lines at
the beginning, like the other modules.

Reviewed-by: ultrotter

72f0f7fd 09/13/2007 02:31 pm Iustin Pop

Fix the ssh change which breaks remote ssh commands

Explanation: since we use lists and not a string, every argument we give
is passed unchanged to the remote shell. So, for example, passing
'/etc/init.d/ganeti restart' to the remote shell, it will try to run the...

00003458 09/07/2007 02:30 pm Guido Trotter

Make import/export use the auxiliary ssh library to build the remote commands.

This avoids forgetting some parameters, as it's happening right now
(the correct known host file is not being passed)

In order to do so we split SSHCall into an auxiliary BuildSSHCmd which builds...

82122173 08/24/2007 12:20 pm Iustin Pop

Rework ssh known-hosts handling.

This changes:
- cluster setup, we no longer edit /etc/ssh/ssh_known_hosts but our
own file
- node add, we no longer remove root's known_hosts (twice)
- gnt-instance console, both the LU and the script: since now the ssh...

3899870e 08/20/2007 04:27 pm Iustin Pop

Disable hashing of the ssh keys.

In case we use StrictHostKeyChecking=ask, also add HashKnownHosts=no so that
debugging is easier. The nodes to which we are connecting are anyway visible in
/etc/ssh/ssh_known_hosts.

3ecf6786 08/14/2007 06:17 pm Iustin Pop

Style changes for pep-8 and python-3000 compliance.

This changes the raising of exceptions from:
raise Exception, value
to
raise Exception(value)

as the first form will be removed in python-3000 and the second form is
preferred now.

The changes also involve a few cases of changing from raising standard...

098c0958 07/26/2007 02:40 pm Michael Hanselmann

Comment formatting updates.

Reviewed-by: iustinp

a8083063 07/16/2007 04:39 pm Iustin Pop

Initial commit.