Fix rendering and start to work on single node haproxy

This commit is contained in:
Liam Young
2016-06-01 14:21:25 +00:00
parent 5838baa303
commit 05a6f92721
2 changed files with 9 additions and 5 deletions

View File

@@ -110,9 +110,7 @@ class PeerHARelationAdapter(OpenStackRelationAdapter):
this node is also on that network"""
for addr_type in ADDRESS_TYPES:
cfg_opt = 'os-{}-network'.format(addr_type)
print(self.config.get(cfg_opt))
laddr = ch_ip.get_address_in_network(self.config.get(cfg_opt))
print(laddr)
if laddr:
netmask = ch_ip.get_netmask_for_address(laddr)
self.cluster_hosts[laddr] = {
@@ -383,6 +381,11 @@ class OpenStackRelationAdapters(object):
def __init__(self, relations, options=ConfigurationAdapter, **kwargs):
self._adapters.update(self.relation_adapters)
self._relations = []
# if not charmhelpers.core.hookenv.relation_ids('cluster'):
# relation_value = {
# }
# setattr(self, 'cluster', relation_value)
# self._relations.append('cluster')
for relation in relations:
relation_name = relation.relation_name.replace('-', '_')
try:

View File

@@ -389,14 +389,15 @@ class OpenStackCharm(object):
target=conf,
context=adapters_instance)
def render_with_interfaces(self, interfaces):
def render_with_interfaces(self, interfaces, configs=None):
"""Render the configs using the interfaces passed; overrides any
interfaces passed in the instance creation.
:param interfaces: list of interface objects to render against
"""
self.render_all_configs(
adapters_instance=self.adapters_class(interfaces))
if not configs:
configs=self.full_restart_map().keys()
self.render_configs(configs, adapters_instance=self.adapters_class(interfaces))
def restart_all(self):
"""Restart all the services configured in the self.services[]