(cluster, context=None)
Generate ca_cert and magnum client cert and set to cluster

    :param cluster: The cluster to set CA cert and magnum client cert
    :returns: CA cert uuid and magnum client cert uuid
Generate ca_cert and magnum client cert and set to cluster
Generate ca_cert and magnum client cert and set to cluster
def generate_certificates_to_cluster(cluster, context=None):
    """Generate ca_cert and magnum client cert and set to cluster

    :param cluster: The cluster to set CA cert and magnum client cert
    :returns: CA cert uuid and magnum client cert uuid
    """
    try:
        issuer_name = _get_issuer_name(cluster)

        LOG.debug('Start to generate certificates: %s', issuer_name)

        ca_cert_ref, ca_cert, ca_password = _generate_ca_cert(issuer_name,
                                                              context=context)
        etcd_ca_cert_ref, _, _ = _generate_ca_cert(issuer_name,
                                                   context=context)
        fp_ca_cert_ref, _, _ = _generate_ca_cert(issuer_name,
                                                 context=context)
        magnum_cert_ref = _generate_client_cert(issuer_name,
                                                ca_cert,
                                                ca_password,
                                                context=context)

        cluster.ca_cert_ref = ca_cert_ref
        cluster.magnum_cert_ref = magnum_cert_ref
        cluster.etcd_ca_cert_ref = etcd_ca_cert_ref
        cluster.front_proxy_ca_cert_ref = fp_ca_cert_ref
    except Exception:
        LOG.exception('Failed to generate certificates for Cluster: %s',
                      cluster.uuid)
        raise exception.CertificatesToClusterFailed(cluster_uuid=cluster.uuid)
def generate_certificates_to_cluster ( cluster , context = None ) : try : issuer_name = _get_issuer_name ( cluster ) LOG . debug ( 'Start to generate certificates: %s' , issuer_name ) ca_cert_ref , ca_cert , ca_password = _generate_ca_cert ( issuer_name , context = context ) etcd_ca_cert_ref , _ , _ = _generate_ca_cert ( issuer_name , context = context ) fp_ca_cert_ref , _ , _ = _generate_ca_cert ( issuer_name , context = context ) magnum_cert_ref = _generate_client_cert ( issuer_name , ca_cert , ca_password , context = context ) cluster . ca_cert_ref = ca_cert_ref cluster . magnum_cert_ref = magnum_cert_ref cluster . etcd_ca_cert_ref = etcd_ca_cert_ref cluster . front_proxy_ca_cert_ref = fp_ca_cert_ref except Exception : LOG . exception ( 'Failed to generate certificates for Cluster: %s' , cluster . uuid ) raise exception . CertificatesToClusterFailed ( cluster_uuid = cluster . uuid )