The nova.virt.powervm.common Module

class Connection(host, username, password, port=22, keyfile=None)

Bases: object

aix_path_join(path_one, path_two)

Ensures file path is built correctly for remote UNIX system

Parameters:
  • path_one – string of the first file path
  • path_two – string of the second file path
Returns:

a uniform path constructed from both strings

ftp_get_command(connection, remote_path, local_path)

Retrieve a file via FTP

Parameters:
  • connection – a Connection object.
  • remote_path – path to the remote file
  • local_path – path to local destination
Raises :

PowerVMFileTransferFailed

ftp_put_command(connection, local_path, remote_dir)

Method to transfer a file via ftp.

Parameters:
  • connection – a Connection object.
  • local_path – path to the local file
  • remote_dir – path to remote destination
Raises :

PowerVMFileTransferFailed

ssh_command_as_root(ssh_connection, cmd, check_exit_code=True)

Method to execute remote command as root.

Parameters:
  • connection – an active paramiko.SSHClient connection.
  • command – string containing the command to run.
Returns:

Tuple – a tuple of (stdout, stderr)

Raises :

nova.exception.ProcessExecutionError

ssh_connect(connection)

Method to connect to remote system using ssh protocol.

Parameters:connection – a Connection object.
Returns:paramiko.SSHClient – an active ssh connection.
Raises :PowerVMConnectionFailed
vios_to_vios_auth(*args, **kwds)

Context allowing for SSH between VIOS partitions

This context will build an SSH key on the source host, put the key into the authorized_keys on the destination host, and make the private key file name available within the context. The key files and key inserted into authorized_keys will be removed when the context exits.

Parameters:
  • source – source IP or DNS name
  • dest – destination IP or DNS name
  • conn_info – dictionary object with SSH connection information for both hosts

Previous topic

The nova.virt.powervm.command Module

Next topic

The nova.virt.powervm.constants Module

This Page