def test_glance_ipv6_context_service_enabled(self, mock_subprocess,
                                              mock_config):
     self.config.return_value = True
     mock_config.return_value = True
     mock_subprocess.return_value = 'true'
     ctxt = contexts.GlanceIPv6Context()
     self.assertEqual(ctxt(), {'bind_host': '::', 'registry_host': '[::]'})
 def test_glance_ipv6_context_service_disabled(self, mock_subprocess,
                                               mock_config):
     self.config.return_value = False
     mock_config.return_value = False
     mock_subprocess.return_value = 'false'
     ctxt = contexts.GlanceIPv6Context()
     self.assertEqual(ctxt(), {'bind_host': '0.0.0.0',
                               'registry_host': '0.0.0.0'})
Beispiel #3
0
}


def ceph_config_file():
    return CHARM_CEPH_CONF.format(service_name())


CONFIG_FILES = OrderedDict([
    (GLANCE_REGISTRY_CONF, {
        'hook_contexts': [
            context.SharedDBContext(ssl_dir=GLANCE_CONF_DIR),
            context.IdentityServiceContext(service='glance',
                                           service_user='******'),
            context.SyslogContext(),
            glance_contexts.LoggingConfigContext(),
            glance_contexts.GlanceIPv6Context(),
            context.WorkerConfigContext(),
            context.OSConfigFlagContext(charm_flag='registry-config-flags',
                                        template_flag='registry_config_flags'),
            context.MemcacheContext()
        ],
        'services': ['glance-registry']
    }),
    (GLANCE_API_CONF, {
        'hook_contexts': [
            context.SharedDBContext(ssl_dir=GLANCE_CONF_DIR),
            context.AMQPContext(ssl_dir=GLANCE_CONF_DIR),
            context.IdentityServiceContext(service='glance',
                                           service_user='******'),
            glance_contexts.GlanceContext(),
            glance_contexts.CephGlanceContext(),