コード例 #1
0
 def _test_is_api_ready(self, tgt):
     fake_config = MagicMock()
     with patch.object(utils, 'incomplete_relation_data') as ird:
         ird.return_value = (not tgt)
         self.assertEqual(utils.is_api_ready(fake_config), tgt)
         ird.assert_called_with(
             fake_config, utils.REQUIRED_INTERFACES)
コード例 #2
0
 def _test_is_api_ready(self, tgt):
     fake_config = MagicMock()
     with patch.object(utils, 'incomplete_relation_data') as ird:
         ird.return_value = (not tgt)
         self.assertEqual(utils.is_api_ready(fake_config), tgt)
         ird.assert_called_with(
             fake_config, utils.REQUIRED_INTERFACES)
コード例 #3
0
def image_service_joined(relation_id=None):
    relation_data = {
        'glance-api-server': "{}:9292".format(canonical_url(CONFIGS, INTERNAL))
    }

    if is_api_ready(CONFIGS):
        relation_data['glance-api-ready'] = 'yes'
    else:
        relation_data['glance-api-ready'] = 'no'

    juju_log("%s: image-service_joined: To peer glance-api-server=%s" %
             (CHARM, relation_data['glance-api-server']))

    relation_set(relation_id=relation_id, **relation_data)
コード例 #4
0
def image_service_joined(relation_id=None):
    relation_data = {
        'glance-api-server':
        "{}:9292".format(canonical_url(CONFIGS, INTERNAL))
    }

    if is_api_ready(CONFIGS):
        relation_data['glance-api-ready'] = 'yes'
    else:
        relation_data['glance-api-ready'] = 'no'

    juju_log("%s: image-service_joined: To peer glance-api-server=%s" %
             (CHARM, relation_data['glance-api-server']))

    relation_set(relation_id=relation_id, **relation_data)
コード例 #5
0
def image_service_joined(relation_id=None):
    relation_data = {
        'glance-api-server': "{}:9292".format(canonical_url(CONFIGS, INTERNAL))
    }

    if is_api_ready(CONFIGS):
        relation_data['glance-api-ready'] = 'yes'
    else:
        relation_data['glance-api-ready'] = 'no'

    juju_log("%s: image-service_joined: To peer glance-api-server=%s" %
             (CHARM, relation_data['glance-api-server']))

    if ('object-store' in CONFIGS.complete_contexts()
            and 'identity-service' in CONFIGS.complete_contexts()):
        relation_data.update({
            'swift-temp-url-key': swift_temp_url_key(),
            'swift-container': 'glance'
        })

    relation_set(relation_id=relation_id, **relation_data)
コード例 #6
0
def image_service_joined(relation_id=None):
    relation_data = {
        'glance-api-server':
        "{}:9292".format(canonical_url(CONFIGS, INTERNAL))
    }

    if is_api_ready(CONFIGS):
        relation_data['glance-api-ready'] = 'yes'
    else:
        relation_data['glance-api-ready'] = 'no'

    juju_log("%s: image-service_joined: To peer glance-api-server=%s" %
             (CHARM, relation_data['glance-api-server']))

    if ('object-store' in CONFIGS.complete_contexts() and
       'identity-service' in CONFIGS.complete_contexts()):
        relation_data.update({
            'swift-temp-url-key': swift_temp_url_key(),
            'swift-container': 'glance'
        })

    relation_set(relation_id=relation_id, **relation_data)