Package ganeti :: Package tools :: Module common
[hide private]
[frames] | no frames]

Module common

source code

Common functions for tool scripts.

Functions [hide private]
 
VerifyOptions(parser, opts, args)
Verifies options and arguments for correctness.
source code
string
_VerifyCertificateStrong(cert_pem, error_fn, _check_fn=utils.CheckNodeCertificate)
Verifies a certificate against the local node daemon certificate.
source code
 
_VerifyCertificateSoft(cert_pem, error_fn, _check_fn=utils.CheckNodeCertificate)
Verifies a certificate against the local node daemon certificate.
source code
string
VerifyCertificateSoft(data, error_fn, _verify_fn=_VerifyCertificateSoft)
Verifies cluster certificate if existing.
source code
string
VerifyCertificateStrong(data, error_fn, _verify_fn=_VerifyCertificateStrong)
Verifies cluster certificate.
source code
 
VerifyClusterName(data, error_fn, cluster_name_constant, _verify_fn=ssconf.VerifyClusterName)
Verifies cluster name.
source code
dict
LoadData(raw, data_check)
Parses and verifies input data.
source code
 
GenerateRootSshKeys(key_type, key_bits, error_fn, _suffix="", _homedir_fn=None)
Generates root's SSH keys for this node.
source code
 
GenerateClientCertificate(data, error_fn, client_cert=pathutils.NODED_CLIENT_CERT_FILE, signing_cert=pathutils.NODED_CERT_FILE)
Regenerates the client certificate of the node.
source code

Imports: logging, OpenSSL, os, time, StringIO, constants, errors, pathutils, utils, serializer, ssconf, ssh


Function Details [hide private]

_VerifyCertificateStrong(cert_pem, error_fn, _check_fn=utils.CheckNodeCertificate)

source code 

Verifies a certificate against the local node daemon certificate.

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

Parameters:
  • cert_pem (string) - Certificate and key in PEM format
  • error_fn (callable) - function to call in case of an error
Returns: string
Formatted key and certificate

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

source code 

Verifies a certificate against the local node daemon certificate.

Parameters:
  • cert_pem (string) - Certificate in PEM format (no key)

VerifyCertificateSoft(data, error_fn, _verify_fn=_VerifyCertificateSoft)

source code 

Verifies cluster certificate if existing.

Parameters:
  • error_fn (callable) - function to call in case of an error
  • data (dict)
Returns: string
Formatted key and certificate

VerifyCertificateStrong(data, error_fn, _verify_fn=_VerifyCertificateStrong)

source code 

Verifies cluster certificate. Throws error when not existing.

Parameters:
  • error_fn (callable) - function to call in case of an error
  • data (dict)
Returns: string
Formatted key and certificate

VerifyClusterName(data, error_fn, cluster_name_constant, _verify_fn=ssconf.VerifyClusterName)

source code 

Verifies cluster name.

Parameters:
  • data (dict)

GenerateClientCertificate(data, error_fn, client_cert=pathutils.NODED_CLIENT_CERT_FILE, signing_cert=pathutils.NODED_CERT_FILE)

source code 

Regenerates the client certificate of the node.

Parameters:
  • data (string) - the JSON-formated input data