add status set to blocked for no v6 addr rxed from storage rel

This commit is contained in:
Edward Hope-Morley 2015-11-06 18:33:58 +00:00
commit 85e326e17d
2 changed files with 12 additions and 0 deletions

View File

@ -214,6 +214,7 @@ def storage_changed():
"(got=%s)" % (addr))
log(msg, level=WARNING)
host_ip = addr
return
else:
host_ip = openstack.get_host_ip(addr)

View File

@ -60,6 +60,7 @@ from charmhelpers.core.host import (
from charmhelpers.contrib.network.ip import (
format_ipv6_addr,
get_ipv6_addr,
is_ipv6,
)
from charmhelpers.core.decorators import (
retry_on_exception,
@ -1057,6 +1058,16 @@ def assess_status(configs):
status_set('blocked', 'Not enough storage zones for minimum replicas')
return
if config('prefer-ipv6'):
for rid in relation_ids('swift-storage'):
for unit in related_units(rid):
addr = relation_get(attribute='private-address', unit=unit,
rid=rid)
if not is_ipv6(addr):
status_set('blocked', 'Did not get IPv6 address from '
'storage relation (got=%s)' % (addr))
return
if relation_ids('identity-service'):
required_interfaces['identity'] = ['identity-service']