fix database sync always get the wrong value

we create a default pool  when exec database sync, and get the
default_pool_id from designate.conf, but we did not register this
opt before using  it, so we always get the default value which is
wrong

Change-Id: I500c932a502db24332aad95c54713b7056bc1df4
Closes-Bug: 1881277
Related-Bug: https://bugs.launchpad.net/kolla-ansible/+bug/1855877
This commit is contained in:
wu.chunyang 2020-09-11 18:57:49 +08:00
parent 06f147f76d
commit 609437e73d
1 changed files with 3 additions and 1 deletions

View File

@ -21,10 +21,12 @@ from sqlalchemy import (Table, MetaData, Column, String, Text, Integer,
from oslo_config import cfg
from oslo_utils import timeutils
from designate.conf import central
from designate.sqlalchemy.types import UUID
CONF = cfg.CONF
central.register_opts(CONF)
RESOURCE_STATUSES = ['ACTIVE', 'PENDING', 'DELETED', 'ERROR']
RECORD_TYPES = ['A', 'AAAA', 'CNAME', 'MX', 'SRV', 'TXT', 'SPF', 'NS', 'PTR',
@ -367,7 +369,7 @@ def default_shard(context, id_col):
def upgrade(migrate_engine):
metadata.bind = migrate_engine
default_pool_id = cfg.CONF['service:central'].default_pool_id
default_pool_id = CONF['service:central'].default_pool_id
with migrate_engine.begin() as conn:
if migrate_engine.name == "mysql":