Refactor code.

This commit is contained in:
Hui Xiang 2014-10-01 00:15:33 +08:00
parent 2dcc38a3f5
commit 0f36f8777d
3 changed files with 4 additions and 15 deletions

View File

@ -111,14 +111,3 @@ class HAProxyContext(context.HAProxyContext):
# for haproxy.conf
ctxt['service_ports'] = port_mapping
return ctxt
class NeutronCCIPv6Context(context.SharedDBContext):
def __call__(self):
ctxt = super(NeutronCCIPv6Context, self).__call__()
if config('prefer-ipv6'):
ctxt['bind_host'] = '::'
else:
ctxt['bind_host'] = '0.0.0.0'
return ctxt

View File

@ -24,8 +24,7 @@ from charmhelpers.core.host import (
)
from charmhelpers.fetch import (
apt_install,
apt_update
apt_install, apt_update
)
from charmhelpers.contrib.openstack.utils import (
@ -343,7 +342,8 @@ def ha_joined():
)
vip_group.append(vip_key)
relation_set(groups={'grp_neutron_vips': ' '.join(vip_group)})
if len(vip_group) >= 1:
relation_set(groups={'grp_neutron_vips': ' '.join(vip_group)})
init_services = {
'res_neutron_haproxy': 'haproxy'

View File

@ -74,7 +74,7 @@ BASE_RESOURCE_MAP = OrderedDict([
neutron_api_context.IdentityServiceContext(),
neutron_api_context.NeutronCCContext(),
context.SyslogContext(),
neutron_api_context.NeutronCCIPv6Context()],
context.BindHostContext()],
}),
(NEUTRON_DEFAULT, {
'services': ['neutron-server'],