(cert_ref, service_name='Magnum', resource_ref=None,
                 check_only=False, **kwargs)
Retrieves the specified cert and registers as a consumer.

        :param cert_ref: the UUID of the cert to retrieve
        :param service_name: Friendly name for the consuming service
        :param resource_ref: Full HATEOAS reference to the consuming resource
        :param check_only: Read Certificate data without registering

        :return: Magnum.certificates.common.Cert representation of the
                 certificate data
        :raises Exception: if certificate retrieval fails
Retrieves the specified cert and registers as a consumer.
Retrieves the specified cert and registers as a consumer .
def get_cert(cert_ref, service_name='Magnum', resource_ref=None,
                 check_only=False, **kwargs):
        """Retrieves the specified cert and registers as a consumer.

        :param cert_ref: the UUID of the cert to retrieve
        :param service_name: Friendly name for the consuming service
        :param resource_ref: Full HATEOAS reference to the consuming resource
        :param check_only: Read Certificate data without registering

        :return: Magnum.certificates.common.Cert representation of the
                 certificate data
        :raises Exception: if certificate retrieval fails
        """
        connection = get_admin_clients().barbican()

        LOG.info("Loading certificate container %s from Barbican.", cert_ref)
        try:
            if check_only:
                cert_container = connection.containers.get(
                    container_ref=cert_ref
                )
            else:
                cert_container = connection.containers.register_consumer(
                    container_ref=cert_ref,
                    name=service_name,
                    url=resource_ref
                )
            return Cert(cert_container)
        except barbican_exc.HTTPClientError:
            with excutils.save_and_reraise_exception():
                LOG.exception("Error getting %s", cert_ref)
def get_cert ( cert_ref , service_name = 'Magnum' , resource_ref = None , check_only = False , * * kwargs ) : connection = get_admin_clients ( ) . barbican ( ) LOG . info ( "Loading certificate container %s from Barbican." , cert_ref ) try : if check_only : cert_container = connection . containers . get ( container_ref = cert_ref ) else : cert_container = connection . containers . register_consumer ( container_ref = cert_ref , name = service_name , url = resource_ref ) return Cert ( cert_container ) except barbican_exc . HTTPClientError : with excutils . save_and_reraise_exception ( ) : LOG . exception ( "Error getting %s" , cert_ref )