fix ipv6 db access
This commit is contained in:
parent
30978b33a3
commit
26263acb56
@ -32,6 +32,7 @@ from charmhelpers.contrib.hahelpers.apache import(
|
|||||||
from charmhelpers.contrib.openstack.utils import (
|
from charmhelpers.contrib.openstack.utils import (
|
||||||
configure_installation_source,
|
configure_installation_source,
|
||||||
openstack_upgrade_available,
|
openstack_upgrade_available,
|
||||||
|
sync_db_with_multi_ipv6_addresses,
|
||||||
)
|
)
|
||||||
from charmhelpers.payload.execd import execd_preinstall
|
from charmhelpers.payload.execd import execd_preinstall
|
||||||
from charmhelpers.core.sysctl import create as create_sysctl
|
from charmhelpers.core.sysctl import create as create_sysctl
|
||||||
@ -138,10 +139,15 @@ def db_joined(relation_id=None):
|
|||||||
'associated a postgresql one')
|
'associated a postgresql one')
|
||||||
log(e, level=ERROR)
|
log(e, level=ERROR)
|
||||||
raise Exception(e)
|
raise Exception(e)
|
||||||
relation_set(username=config('database-user'),
|
|
||||||
database=config('database'),
|
if config('prefer-ipv6'):
|
||||||
hostname=unit_get('private-address'),
|
sync_db_with_multi_ipv6_addresses(config('database'),
|
||||||
relation_id=relation_id)
|
config('database-user'))
|
||||||
|
else:
|
||||||
|
relation_set(username=config('database-user'),
|
||||||
|
database=config('database'),
|
||||||
|
hostname=unit_get('private-address'),
|
||||||
|
relation_id=relation_id)
|
||||||
|
|
||||||
|
|
||||||
@hooks.hook('pgsql-db-relation-joined')
|
@hooks.hook('pgsql-db-relation-joined')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user