module documentation

Script to prepare a node for joining a cluster.

Exception JoinError Local class for reporting errors.
Function Main Main routine.
Function ParseOptions Parses the options passed to the program.
Function UpdateSshDaemon Updates SSH daemon's keys.
Function UpdateSshRoot Updates root's SSH keys.
Function _UpdateKeyFiles Updates SSH key files.
Constant _DATA_CHECK Undocumented
Constant _SSH_KEY_LIST Undocumented
Constant _SSH_KEY_LIST_ITEM Undocumented
def Main():

Main routine.

def ParseOptions():

Parses the options passed to the program.

Returns
Options and arguments
def UpdateSshDaemon(data, dry_run, _runcmd_fn=utils.RunCmd, _keyfiles=None):

Updates SSH daemon's keys.

Unless dry_run is set, the daemon is restarted at the end.

Parameters
data:dictInput data
dry_run:booleanWhether to perform a dry run
_runcmd_fnUndocumented
_keyfilesUndocumented
def UpdateSshRoot(data, dry_run, _homedir_fn=None):

Updates root's SSH keys.

Root's authorized_keys file is also updated with new public keys.

Parameters
data:dictInput data
dry_run:booleanWhether to perform a dry run
_homedir_fnUndocumented
def _UpdateKeyFiles(keys, dry_run, keyfiles):

Updates SSH key files.

Parameters
keys:sequence of tuple; (string, string, string)Keys to write, tuples consist of key type (constants.SSHK_ALL), public and private key
dry_run:booleanWhether to perform a dry run
keyfiles:dict; (string as key, tuple with (string, string) as values)Mapping from key types (constants.SSHK_ALL) to file names; value tuples consist of public key filename and private key filename
_SSH_KEY_LIST =

Undocumented

Value
ht.TListOf(_SSH_KEY_LIST_ITEM)
_SSH_KEY_LIST_ITEM =