module documentation

Common functions for tool scripts.

Function GenerateClientCertificate Regenerates the client certificate of the node.
Function GenerateRootSshKeys Generates root's SSH keys for this node.
Function LoadData Parses and verifies input data.
Function VerifyCertificateSoft Verifies cluster certificate if existing.
Function VerifyCertificateStrong Verifies cluster certificate. Throws error when not existing.
Function VerifyClusterName Verifies cluster name.
Function VerifyHmac Verifies the presence of the hmac secret.
Function VerifyOptions Verifies options and arguments for correctness.
Function _VerifyCertificateSoft Verifies a certificate against the local node daemon certificate.
Function _VerifyCertificateStrong Verifies a certificate against the local node daemon certificate.
def GenerateClientCertificate(data, error_fn, client_cert=pathutils.NODED_CLIENT_CERT_FILE, signing_cert=pathutils.NODED_CERT_FILE):

Regenerates the client certificate of the node.

Parameters
data:stringthe JSON-formated input data
error_fnUndocumented
client_certUndocumented
signing_certUndocumented
def GenerateRootSshKeys(key_type, key_bits, error_fn, _suffix='', _homedir_fn=None):

Generates root's SSH keys for this node.

def LoadData(raw, data_check):

Parses and verifies input data.

Returns
dictUndocumented
def VerifyCertificateSoft(data, error_fn, _verify_fn=_VerifyCertificateSoft):

Verifies cluster certificate if existing.

Parameters
data:dictUndocumented
error_fn:callablefunction to call in case of an error
_verify_fnUndocumented
Returns
stringFormatted key and certificate
def VerifyCertificateStrong(data, error_fn, _verify_fn=_VerifyCertificateStrong):

Verifies cluster certificate. Throws error when not existing.

Parameters
data:dictUndocumented
error_fn:callablefunction to call in case of an error
_verify_fnUndocumented
Returns
stringFormatted key and certificate
def VerifyClusterName(data, error_fn, cluster_name_constant, _verify_fn=ssconf.VerifyClusterName):

Verifies cluster name.

Parameters
data:dictUndocumented
error_fnUndocumented
cluster_name_constantUndocumented
_verify_fnUndocumented
def VerifyHmac(data, error_fn):

Verifies the presence of the hmac secret.

Parameters
data:dictUndocumented
error_fnUndocumented
def VerifyOptions(parser, opts, args):

Verifies options and arguments for correctness.

def _VerifyCertificateSoft(cert_pem, error_fn, _check_fn=utils.CheckNodeCertificate):

Verifies a certificate against the local node daemon certificate.

Parameters
cert_pem:stringCertificate in PEM format (no key)
error_fnUndocumented
_check_fnUndocumented
def _VerifyCertificateStrong(cert_pem, error_fn, _check_fn=utils.CheckNodeCertificate):

Verifies a certificate against the local node daemon certificate.

Includes elaborate tests of encodings etc., and returns formatted certificate.

Parameters
cert_pem:stringCertificate and key in PEM format
error_fn:callablefunction to call in case of an error
_check_fnUndocumented
Returns
stringFormatted key and certificate