Module encapsulating ssh functionality.
tuple; (string, string, string)
|
GetUserFiles(user,
mkdir=False,
dircheck=True,
kind=constants.SSHK_DSA,
_homedir_fn=None)
Return the paths of a user's SSH files. |
source code
|
|
tuple; (string, dict with string as key, tuple of (string, string) as
value)
|
|
tuple
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(boolean, string)
|
|
string
|
|
(boolean, string)
|
|
string
|
|
(boolean, string)
|
|
string
|
|
tuple (string, string)
|
|
|
_ManipulatePubKeyFile(target_identifier,
target_key,
key_file=pathutils.SSH_PUB_KEYS,
error_fn=errors.ProgrammerError,
process_line_fn=None,
process_else_fn=None)
Manipulates the list of public SSH keys of the cluster. |
source code
|
|
|
AddPublicKey(new_uuid,
new_key,
key_file=pathutils.SSH_PUB_KEYS,
error_fn=errors.ProgrammerError)
Adds a new key to the list of public keys. |
source code
|
|
|
RemovePublicKey(target_uuid,
key_file=pathutils.SSH_PUB_KEYS,
error_fn=errors.ProgrammerError)
Removes a key from the list of public keys. |
source code
|
|
|
ReplaceNameByUuid(node_uuid,
node_name,
key_file=pathutils.SSH_PUB_KEYS,
error_fn=errors.ProgrammerError)
Replaces a host name with the node's corresponding UUID. |
source code
|
|
|
ClearPubKeyFile(key_file=pathutils.SSH_PUB_KEYS,
mode=0600)
Resets the content of the public key file. |
source code
|
|
|
|
dict mapping strings to list of strings
|
QueryPubKeyFile(target_uuids,
key_file=pathutils.SSH_PUB_KEYS,
error_fn=errors.ProgrammerError)
Retrieves a map of keys for the requested node UUIDs. |
source code
|
|
|
InitSSHSetup(key_type,
key_bits,
error_fn=errors.OpPrereqError,
_homedir_fn=None,
_suffix="")
Setup the SSH configuration for the node. |
source code
|
|
|
InitPubKeyFile(master_uuid,
key_type,
key_file=pathutils.SSH_PUB_KEYS)
Creates the public key file and adds the master node's SSH key. |
source code
|
|
|
WriteKnownHostsFile(cfg,
file_name)
Writes the cluster-wide equally known_hosts file. |
source code
|
|
list of strings
|
|
|
RunSshCmdWithStdin(cluster_name,
node,
basecmd,
port,
data,
debug=False,
verbose=False,
use_cluster_key=False,
ask_key=False,
strict_host_check=False,
ensure_version=False)
Runs a command on a remote machine via SSH and provides input in
stdin. |
source code
|
|
|
|
positive int
|
DetermineKeyBits(key_type,
key_bits,
old_key_type,
old_key_bits)
Checks the key bits to be used for a given key type, or provides
defaults. |
source code
|
|