コード例 #1
0
def get_relation_cert_data():
    """Get certificate bundle associated with the amqp interface.

    :returns: Dict with key, cert, ca and, optional, chain keys.
    :rtype: Dict
    """
    _, hostname = get_unit_amqp_endpoint_data()
    return ch_cert_utils.get_bundle_for_cn(hostname)
コード例 #2
0
def get_relation_cert_data():
    """Get certificate bundle associated with the amqp interface.

    :returns: Dict with key, cert, ca and, optional, chain keys.
    :rtype: Dict
    """
    _, hostname = get_unit_amqp_endpoint_data()
    return ch_cert_utils.get_bundle_for_cn(hostname)
コード例 #3
0
 def test_get_bundle_for_cn(self, get_requests_for_local_unit):
     get_requests_for_local_unit.return_value = [{
         'ca': 'ROOTCA',
         'certs': {
             'juju-cd4bb3-5.lxd': {
                 'cert': 'BASECERT',
                 'key': 'BASEKEY'},
             'juju-cd4bb3-5.internal': {
                 'cert': 'INTERNALCERT',
                 'key': 'INTERNALKEY'}},
         'chain': 'MYCHAIN'}]
     self.assertEqual(
         cert_utils.get_bundle_for_cn('juju-cd4bb3-5.internal'),
         {
             'ca': 'ROOTCA',
             'cert': 'INTERNALCERT',
             'chain': 'MYCHAIN',
             'key': 'INTERNALKEY'})