def test_restart_map(self):
        self.service_name.return_value = 'glance'

        ex_map = OrderedDict([
            (utils.GLANCE_REGISTRY_CONF, ['glance-registry']),
            (utils.GLANCE_API_CONF, ['glance-api']),
            (utils.ceph_config_file(), ['glance-api', 'glance-registry']),
            (utils.HAPROXY_CONF, ['haproxy']),
            (utils.HTTPS_APACHE_CONF, ['apache2']),
            (utils.HTTPS_APACHE_24_CONF, ['apache2'])
        ])
        self.assertEquals(ex_map, utils.restart_map())
Beispiel #2
0
    def test_restart_map(self):
        self.service_name.return_value = 'glance'

        ex_map = OrderedDict([
            (utils.GLANCE_REGISTRY_CONF, ['glance-registry']),
            (utils.GLANCE_API_CONF, ['glance-api']),
            (utils.ceph_config_file(), ['glance-api', 'glance-registry']),
            (utils.HAPROXY_CONF, ['haproxy']),
            (utils.HTTPS_APACHE_CONF, ['apache2']),
            (utils.HTTPS_APACHE_24_CONF, ['apache2'])
        ])
        self.assertEquals(ex_map, utils.restart_map())
Beispiel #3
0
 def test_register_configs_ceph(self, exists):
     exists.return_value = True
     self.os_release.return_value = 'grizzly'
     self.relation_ids.return_value = ['ceph:0']
     self.service_name.return_value = 'glance'
     configs = utils.register_configs()
     calls = []
     for conf in [
             utils.GLANCE_REGISTRY_CONF, utils.GLANCE_API_CONF,
             utils.HAPROXY_CONF,
             utils.ceph_config_file()
     ]:
         calls.append(call(conf, utils.CONFIG_FILES[conf]['hook_contexts']))
     configs.register.assert_has_calls(calls, any_order=True)
     self.mkdir.assert_called_with('/etc/ceph')
 def test_register_configs_ceph(self, exists):
     exists.return_value = True
     self.os_release.return_value = 'grizzly'
     self.relation_ids.return_value = ['ceph:0']
     self.service_name.return_value = 'glance'
     configs = utils.register_configs()
     calls = []
     for conf in [utils.GLANCE_REGISTRY_CONF,
                  utils.GLANCE_API_CONF,
                  utils.HAPROXY_CONF,
                  utils.ceph_config_file()]:
         calls.append(
             call(conf,
                  utils.CONFIG_FILES[conf]['hook_contexts'])
         )
     configs.register.assert_has_calls(calls, any_order=True)
     self.mkdir.assert_called_with('/etc/ceph')
Beispiel #5
0
    def test_restart_map(self):
        self.enable_memcache.return_value = True
        self.config.side_effect = None
        self.service_name.return_value = 'glance'

        ex_map = OrderedDict([
            (utils.GLANCE_REGISTRY_CONF, ['glance-registry']),
            (utils.GLANCE_API_CONF, ['glance-api']),
            (utils.ceph_config_file(), ['glance-api', 'glance-registry']),
            (utils.HAPROXY_CONF, ['haproxy']),
            (utils.HTTPS_APACHE_CONF, ['apache2']),
            (utils.HTTPS_APACHE_24_CONF, ['apache2']),
            (utils.MEMCACHED_CONF, ['memcached']),
            (utils.GLANCE_POLICY_FILE, ['glance-api', 'glance-registry'])
        ])
        self.assertEqual(ex_map, utils.restart_map())
        self.enable_memcache.return_value = False
        del ex_map[utils.MEMCACHED_CONF]
        self.assertEqual(ex_map, utils.restart_map())