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
_VerifyCertificate(cert_pem, error_fn, _check_fn=utils.CheckNodeCertificate)
Verifies a certificate against the local node daemon certificate.
source code
string
VerifyCertificate(data, error_fn, _verify_fn=_VerifyCertificate)
Verifies cluster certificate.
source code
 
VerifyClusterName(data, error_fn, _verify_fn=ssconf.VerifyClusterName)
Verifies cluster name.
source code
dict
LoadData(raw, data_check)
Parses and verifies input data.
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, pathutils, utils, serializer, ssconf


Function Details [hide private]

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

source code 

Verifies a certificate against the local node daemon 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

VerifyCertificate(data, error_fn, _verify_fn=_VerifyCertificate)

source code 

Verifies cluster certificate.

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

VerifyClusterName(data, error_fn, _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