Added IPv6 support

Added test to check that IPv6 addresses are properly formatted.
This commit is contained in:
Felipe Reyes
2014-11-26 18:24:02 -03:00
parent 686d3a6211
commit 48ed1df3cb
2 changed files with 25 additions and 6 deletions

View File

@@ -13,7 +13,8 @@ from charmhelpers.contrib.hahelpers.cluster import (
)
from charmhelpers.contrib.network.ip import (
get_ipv6_addr
get_ipv6_addr,
format_ipv6_addr
)
@@ -292,7 +293,10 @@ class InstanceConsoleContext(context.OSContextGenerator):
try:
for rid in relation_ids('memcache'):
for rel in relations_for_id(rid):
servers.append({'private-address': rel['private-address'],
priv_addr = rel['private-address']
# format it as IPv6 address if neeeded
priv_addr = format_ipv6_addr(priv_addr) or priv_addr
servers.append({'private-address': priv_addr,
'port': rel['port']})
except Exception as ex:
log("Couldn't get caching servers: {}".format(str(ex)),