Standardize all configuration loading
There was a large config refactor many releases ago, but we never standardized on the new pattern. This will also help ensure that config is always loaded in the right order. - Standardize how config is setup throughout designate. - Removed unecessary import_opt. Change-Id: I8913d2569f174208740a76c474c73316f6c1d89e
This commit is contained in:
parent
68fc28527a
commit
cc0431ba62
@ -12,15 +12,18 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import pecan.deploy
|
import pecan.deploy
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def factory(global_config, **local_conf):
|
def factory(global_config, **local_conf):
|
||||||
if not cfg.CONF['service:api'].enable_api_admin:
|
if not CONF['service:api'].enable_api_admin:
|
||||||
def disabled_app(environ, start_response):
|
def disabled_app(environ, start_response):
|
||||||
status = '404 Not Found'
|
status = '404 Not Found'
|
||||||
start_response(status, [])
|
start_response(status, [])
|
||||||
|
@ -13,17 +13,20 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
import pecan
|
import pecan
|
||||||
import pecan.deploy
|
import pecan.deploy
|
||||||
|
|
||||||
from designate.api.v2 import patches
|
from designate.api.v2 import patches
|
||||||
|
import designate.conf
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
def setup_app(pecan_config):
|
def setup_app(pecan_config):
|
||||||
config = dict(pecan_config)
|
config = dict(pecan_config)
|
||||||
|
|
||||||
config['app']['debug'] = cfg.CONF['service:api'].pecan_debug
|
config['app']['debug'] = CONF['service:api'].pecan_debug
|
||||||
|
|
||||||
pecan.configuration.set_config(config, overwrite=True)
|
pecan.configuration.set_config(config, overwrite=True)
|
||||||
|
|
||||||
|
@ -12,13 +12,14 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from stevedore import named
|
from stevedore import named
|
||||||
|
|
||||||
from designate.api.v2.controllers import errors
|
from designate.api.v2.controllers import errors
|
||||||
|
import designate.conf
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -29,7 +30,7 @@ class RootController:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
enabled_ext = cfg.CONF['service:api'].enabled_extensions_admin
|
enabled_ext = CONF['service:api'].enabled_extensions_admin
|
||||||
if len(enabled_ext) > 0:
|
if len(enabled_ext) > 0:
|
||||||
self._mgr = named.NamedExtensionManager(
|
self._mgr = named.NamedExtensionManager(
|
||||||
namespace='designate.api.admin.extensions',
|
namespace='designate.api.admin.extensions',
|
||||||
|
@ -15,15 +15,15 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
from urllib import parse
|
from urllib import parse
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate import objects
|
from designate import objects
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
|
|
||||||
class BaseView:
|
class BaseView:
|
||||||
@ -141,12 +141,12 @@ class BaseView:
|
|||||||
# parents)
|
# parents)
|
||||||
|
|
||||||
# defined in etc/designate/designate.conf.sample
|
# defined in etc/designate/designate.conf.sample
|
||||||
limit = cfg.CONF['service:api'].default_limit_admin
|
limit = CONF['service:api'].default_limit_admin
|
||||||
|
|
||||||
if 'limit' in params:
|
if 'limit' in params:
|
||||||
limit = params['limit']
|
limit = params['limit']
|
||||||
if limit.lower() == 'max':
|
if limit.lower() == 'max':
|
||||||
limit = cfg.CONF['service:api'].max_limit_admin
|
limit = CONF['service:api'].max_limit_admin
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
limit = int(limit)
|
limit = int(limit)
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
import flask
|
import flask
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import oslo_messaging as messaging
|
import oslo_messaging as messaging
|
||||||
from oslo_middleware import base
|
from oslo_middleware import base
|
||||||
@ -23,6 +22,7 @@ from oslo_serialization import jsonutils
|
|||||||
from oslo_utils import strutils
|
from oslo_utils import strutils
|
||||||
import webob.dec
|
import webob.dec
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import context
|
from designate import context
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate import notifications
|
from designate import notifications
|
||||||
@ -30,6 +30,7 @@ from designate import objects
|
|||||||
from designate.objects.adapters import DesignateAdapter
|
from designate.objects.adapters import DesignateAdapter
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -39,7 +40,7 @@ def auth_pipeline_factory(loader, global_conf, **local_conf):
|
|||||||
|
|
||||||
Code nabbed from cinder.
|
Code nabbed from cinder.
|
||||||
"""
|
"""
|
||||||
pipeline = local_conf[cfg.CONF['service:api'].auth_strategy]
|
pipeline = local_conf[CONF['service:api'].auth_strategy]
|
||||||
pipeline = pipeline.split()
|
pipeline = pipeline.split()
|
||||||
LOG.info('Getting auth pipeline: %s', pipeline[:-1])
|
LOG.info('Getting auth pipeline: %s', pipeline[:-1])
|
||||||
filters = [loader.get_filter(n) for n in pipeline[:-1]]
|
filters = [loader.get_filter(n) for n in pipeline[:-1]]
|
||||||
@ -227,8 +228,8 @@ class MaintenanceMiddleware(base.Middleware):
|
|||||||
|
|
||||||
LOG.info('Starting designate maintenance middleware')
|
LOG.info('Starting designate maintenance middleware')
|
||||||
|
|
||||||
self.enabled = cfg.CONF['service:api'].maintenance_mode
|
self.enabled = CONF['service:api'].maintenance_mode
|
||||||
self.role = cfg.CONF['service:api'].maintenance_mode_role
|
self.role = CONF['service:api'].maintenance_mode_role
|
||||||
|
|
||||||
def process_request(self, request):
|
def process_request(self, request):
|
||||||
# If maintaince mode is not enabled, pass the request on as soon as
|
# If maintaince mode is not enabled, pass the request on as soon as
|
||||||
|
@ -13,14 +13,16 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from paste import deploy
|
from paste import deploy
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate import service
|
from designate import service
|
||||||
from designate import utils
|
from designate import utils
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -29,7 +31,7 @@ class Service(service.WSGIService):
|
|||||||
super().__init__(
|
super().__init__(
|
||||||
self.wsgi_application,
|
self.wsgi_application,
|
||||||
self.service_name,
|
self.service_name,
|
||||||
cfg.CONF['service:api'].listen,
|
CONF['service:api'].listen,
|
||||||
)
|
)
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
@ -44,7 +46,7 @@ class Service(service.WSGIService):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def wsgi_application(self):
|
def wsgi_application(self):
|
||||||
api_paste_config = cfg.CONF['service:api'].api_paste_config
|
api_paste_config = CONF['service:api'].api_paste_config
|
||||||
config_paths = utils.find_config(api_paste_config)
|
config_paths = utils.find_config(api_paste_config)
|
||||||
|
|
||||||
if not config_paths:
|
if not config_paths:
|
||||||
|
@ -13,16 +13,18 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import pecan.deploy
|
import pecan.deploy
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def factory(global_config, **local_conf):
|
def factory(global_config, **local_conf):
|
||||||
if not cfg.CONF['service:api'].enable_api_v2:
|
if not CONF['service:api'].enable_api_v2:
|
||||||
def disabled_app(environ, start_response):
|
def disabled_app(environ, start_response):
|
||||||
status = '404 Not Found'
|
status = '404 Not Found'
|
||||||
start_response(status, [])
|
start_response(status, [])
|
||||||
|
@ -13,17 +13,20 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
import pecan
|
import pecan
|
||||||
import pecan.deploy
|
import pecan.deploy
|
||||||
|
|
||||||
from designate.api.v2 import patches
|
from designate.api.v2 import patches
|
||||||
|
import designate.conf
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
def setup_app(pecan_config):
|
def setup_app(pecan_config):
|
||||||
config = dict(pecan_config)
|
config = dict(pecan_config)
|
||||||
|
|
||||||
config['app']['debug'] = cfg.CONF['service:api'].pecan_debug
|
config['app']['debug'] = CONF['service:api'].pecan_debug
|
||||||
|
|
||||||
pecan.configuration.set_config(config, overwrite=True)
|
pecan.configuration.set_config(config, overwrite=True)
|
||||||
|
|
||||||
|
@ -13,13 +13,13 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
import pecan
|
import pecan
|
||||||
|
|
||||||
from designate.api.v2.controllers import rest
|
from designate.api.v2.controllers import rest
|
||||||
|
import designate.conf
|
||||||
|
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class LimitsController(rest.RestController):
|
class LimitsController(rest.RestController):
|
||||||
|
@ -13,16 +13,18 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import pecan
|
import pecan
|
||||||
|
|
||||||
from designate.api.v2.controllers import rest
|
from designate.api.v2.controllers import rest
|
||||||
from designate.common import keystone
|
from designate.common import keystone
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate.objects.adapters import DesignateAdapter
|
from designate.objects.adapters import DesignateAdapter
|
||||||
from designate.objects import QuotaList
|
from designate.objects import QuotaList
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -59,7 +61,7 @@ class QuotasController(rest.RestController):
|
|||||||
# on a best effort basis
|
# on a best effort basis
|
||||||
# this will raise only if KeystoneV3 endpoint is not found at all,
|
# this will raise only if KeystoneV3 endpoint is not found at all,
|
||||||
# or the creds are passing but the project is not found
|
# or the creds are passing but the project is not found
|
||||||
if cfg.CONF['service:api'].quotas_verify_project_id:
|
if CONF['service:api'].quotas_verify_project_id:
|
||||||
keystone.verify_project_id(context, project_id)
|
keystone.verify_project_id(context, project_id)
|
||||||
|
|
||||||
quotas = DesignateAdapter.parse('API_v2', body, QuotaList())
|
quotas = DesignateAdapter.parse('API_v2', body, QuotaList())
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
from stevedore import named
|
from stevedore import named
|
||||||
|
|
||||||
from designate.api.v2.controllers import blacklists
|
from designate.api.v2.controllers import blacklists
|
||||||
@ -27,6 +26,10 @@ from designate.api.v2.controllers import service_status
|
|||||||
from designate.api.v2.controllers import tlds
|
from designate.api.v2.controllers import tlds
|
||||||
from designate.api.v2.controllers import tsigkeys
|
from designate.api.v2.controllers import tsigkeys
|
||||||
from designate.api.v2.controllers import zones
|
from designate.api.v2.controllers import zones
|
||||||
|
import designate.conf
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class RootController:
|
class RootController:
|
||||||
@ -36,7 +39,7 @@ class RootController:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
enabled_ext = cfg.CONF['service:api'].enabled_extensions_v2
|
enabled_ext = CONF['service:api'].enabled_extensions_v2
|
||||||
if len(enabled_ext) > 0:
|
if len(enabled_ext) > 0:
|
||||||
self._mgr = named.NamedExtensionManager(
|
self._mgr = named.NamedExtensionManager(
|
||||||
namespace='designate.api.v2.extensions',
|
namespace='designate.api.v2.extensions',
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import pecan
|
import pecan
|
||||||
|
|
||||||
@ -22,14 +21,14 @@ from designate.api.v2.controllers.zones import nameservers
|
|||||||
from designate.api.v2.controllers.zones import recordsets
|
from designate.api.v2.controllers.zones import recordsets
|
||||||
from designate.api.v2.controllers.zones import sharedzones
|
from designate.api.v2.controllers.zones import sharedzones
|
||||||
from designate.api.v2.controllers.zones import tasks
|
from designate.api.v2.controllers.zones import tasks
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate import objects
|
from designate import objects
|
||||||
from designate.objects.adapters import DesignateAdapter
|
from designate.objects.adapters import DesignateAdapter
|
||||||
from designate import utils
|
from designate import utils
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,11 +14,12 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
import flask
|
import flask
|
||||||
from oslo_config import cfg
|
|
||||||
|
|
||||||
from designate.common import constants
|
from designate.common import constants
|
||||||
|
import designate.conf
|
||||||
|
|
||||||
cfg.CONF.import_opt('enable_host_header', 'designate.api', group='service:api')
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
def _add_a_version(versions, version, api_url, status, timestamp):
|
def _add_a_version(versions, version, api_url, status, timestamp):
|
||||||
@ -38,10 +39,10 @@ def factory(global_config, **local_conf):
|
|||||||
|
|
||||||
@app.route('/', methods=['GET'])
|
@app.route('/', methods=['GET'])
|
||||||
def version_list():
|
def version_list():
|
||||||
if cfg.CONF['service:api'].enable_host_header:
|
if CONF['service:api'].enable_host_header:
|
||||||
url_root = flask.request.url_root
|
url_root = flask.request.url_root
|
||||||
else:
|
else:
|
||||||
url_root = cfg.CONF['service:api'].api_base_uri
|
url_root = CONF['service:api'].api_base_uri
|
||||||
api_url = url_root.rstrip('/') + '/v2'
|
api_url = url_root.rstrip('/') + '/v2'
|
||||||
|
|
||||||
versions = []
|
versions = []
|
||||||
|
@ -19,12 +19,13 @@ from paste import deploy
|
|||||||
|
|
||||||
from designate.common import config
|
from designate.common import config
|
||||||
from designate.common import profiler
|
from designate.common import profiler
|
||||||
from designate import conf
|
import designate.conf
|
||||||
from designate import heartbeat_emitter
|
from designate import heartbeat_emitter
|
||||||
from designate import policy
|
from designate import policy
|
||||||
from designate import rpc
|
from designate import rpc
|
||||||
|
|
||||||
CONF = conf.CONF
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
CONFIG_FILES = ['api-paste.ini', 'designate.conf']
|
CONFIG_FILES = ['api-paste.ini', 'designate.conf']
|
||||||
|
|
||||||
@ -41,7 +42,7 @@ def init_application():
|
|||||||
logging.register_options(cfg.CONF)
|
logging.register_options(cfg.CONF)
|
||||||
cfg.CONF([], project='designate', default_config_files=conf_files)
|
cfg.CONF([], project='designate', default_config_files=conf_files)
|
||||||
config.set_defaults()
|
config.set_defaults()
|
||||||
logging.setup(cfg.CONF, 'designate')
|
logging.setup(CONF, 'designate')
|
||||||
|
|
||||||
policy.init()
|
policy.init()
|
||||||
|
|
||||||
|
@ -15,14 +15,15 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
import abc
|
import abc
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate.context import DesignateContext
|
from designate.context import DesignateContext
|
||||||
from designate.plugin import DriverPlugin
|
from designate.plugin import DriverPlugin
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class Backend(DriverPlugin):
|
class Backend(DriverPlugin):
|
||||||
|
@ -16,18 +16,19 @@
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
from eventlet import Timeout
|
from eventlet import Timeout
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
import requests
|
import requests
|
||||||
from requests.adapters import HTTPAdapter
|
from requests.adapters import HTTPAdapter
|
||||||
|
|
||||||
from designate.backend import base
|
from designate.backend import base
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate import utils
|
from designate import utils
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
CONF = cfg.CONF
|
|
||||||
CFG_GROUP_NAME = 'backend:dynect'
|
CFG_GROUP_NAME = 'backend:dynect'
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,16 +14,17 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
from urllib import parse
|
from urllib import parse
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
from oslo_utils import strutils
|
from oslo_utils import strutils
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from designate.backend.impl_infoblox import ibexceptions as exc
|
from designate.backend.impl_infoblox import ibexceptions as exc
|
||||||
|
import designate.conf
|
||||||
|
|
||||||
|
|
||||||
CFG_GROUP_NAME = 'backend:infoblox'
|
CFG_GROUP_NAME = 'backend:infoblox'
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,15 +13,16 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from designate.backend import base
|
from designate.backend import base
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class NS1Backend(base.Backend):
|
class NS1Backend(base.Backend):
|
||||||
|
@ -15,15 +15,16 @@ import ipaddress
|
|||||||
import os.path
|
import os.path
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from designate.backend import base
|
from designate.backend import base
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class PDNS4Backend(base.Backend):
|
class PDNS4Backend(base.Backend):
|
||||||
|
@ -13,15 +13,16 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import oslo_messaging as messaging
|
import oslo_messaging as messaging
|
||||||
|
|
||||||
from designate.common import profiler
|
from designate.common import profiler
|
||||||
|
import designate.conf
|
||||||
from designate.loggingutils import rpc_logging
|
from designate.loggingutils import rpc_logging
|
||||||
from designate import rpc
|
from designate import rpc
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
CENTRAL_API = None
|
CENTRAL_API = None
|
||||||
@ -80,7 +81,7 @@ class CentralAPI:
|
|||||||
LOGGING_BLACKLIST = ['update_service_status']
|
LOGGING_BLACKLIST = ['update_service_status']
|
||||||
|
|
||||||
def __init__(self, topic=None):
|
def __init__(self, topic=None):
|
||||||
self.topic = topic if topic else cfg.CONF['service:central'].topic
|
self.topic = topic if topic else CONF['service:central'].topic
|
||||||
|
|
||||||
target = messaging.Target(topic=self.topic,
|
target = messaging.Target(topic=self.topic,
|
||||||
version=self.RPC_API_VERSION)
|
version=self.RPC_API_VERSION)
|
||||||
|
@ -24,7 +24,6 @@ import time
|
|||||||
|
|
||||||
from dns import exception as dnsexception
|
from dns import exception as dnsexception
|
||||||
from dns import zone as dnszone
|
from dns import zone as dnszone
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import oslo_messaging as messaging
|
import oslo_messaging as messaging
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
@ -33,6 +32,7 @@ from designate.common import constants
|
|||||||
from designate.common.decorators import lock
|
from designate.common.decorators import lock
|
||||||
from designate.common.decorators import notification
|
from designate.common.decorators import notification
|
||||||
from designate.common.decorators import rpc
|
from designate.common.decorators import rpc
|
||||||
|
import designate.conf
|
||||||
from designate import coordination
|
from designate import coordination
|
||||||
from designate import dnsutils
|
from designate import dnsutils
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
@ -48,6 +48,8 @@ from designate.storage import transaction_shallow_copy
|
|||||||
from designate import utils
|
from designate import utils
|
||||||
from designate.worker import rpcapi as worker_rpcapi
|
from designate.worker import rpcapi as worker_rpcapi
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -65,13 +67,13 @@ class Service(service.RPCService):
|
|||||||
self._quota = None
|
self._quota = None
|
||||||
|
|
||||||
super().__init__(
|
super().__init__(
|
||||||
self.service_name, cfg.CONF['service:central'].topic,
|
self.service_name, CONF['service:central'].topic,
|
||||||
threads=cfg.CONF['service:central'].threads,
|
threads=CONF['service:central'].threads,
|
||||||
)
|
)
|
||||||
self.coordination = coordination.Coordination(
|
self.coordination = coordination.Coordination(
|
||||||
self.service_name, self.tg, grouping_enabled=False
|
self.service_name, self.tg, grouping_enabled=False
|
||||||
)
|
)
|
||||||
self.network_api = network_api.get_network_api(cfg.CONF.network_api)
|
self.network_api = network_api.get_network_api(CONF.network_api)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def scheduler(self):
|
def scheduler(self):
|
||||||
@ -98,7 +100,7 @@ class Service(service.RPCService):
|
|||||||
return 'central'
|
return 'central'
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
if (cfg.CONF['service:central'].managed_resource_tenant_id ==
|
if (CONF['service:central'].managed_resource_tenant_id ==
|
||||||
"00000000-0000-0000-0000-000000000000"):
|
"00000000-0000-0000-0000-000000000000"):
|
||||||
LOG.warning("Managed Resource Tenant ID is not properly "
|
LOG.warning("Managed Resource Tenant ID is not properly "
|
||||||
"configured")
|
"configured")
|
||||||
@ -119,7 +121,7 @@ class Service(service.RPCService):
|
|||||||
if zone_name is None:
|
if zone_name is None:
|
||||||
raise exceptions.InvalidObject
|
raise exceptions.InvalidObject
|
||||||
|
|
||||||
if len(zone_name) > cfg.CONF['service:central'].max_zone_name_len:
|
if len(zone_name) > CONF['service:central'].max_zone_name_len:
|
||||||
raise exceptions.InvalidZoneName('Name too long')
|
raise exceptions.InvalidZoneName('Name too long')
|
||||||
|
|
||||||
# Break the zone name up into its component labels
|
# Break the zone name up into its component labels
|
||||||
@ -172,7 +174,7 @@ class Service(service.RPCService):
|
|||||||
raise ValueError('Please supply a FQDN')
|
raise ValueError('Please supply a FQDN')
|
||||||
|
|
||||||
# Validate record name length
|
# Validate record name length
|
||||||
max_len = cfg.CONF['service:central'].max_recordset_name_len
|
max_len = CONF['service:central'].max_recordset_name_len
|
||||||
if len(recordset_name) > max_len:
|
if len(recordset_name) > max_len:
|
||||||
raise exceptions.InvalidRecordSetName('Name too long')
|
raise exceptions.InvalidRecordSetName('Name too long')
|
||||||
|
|
||||||
@ -336,7 +338,7 @@ class Service(service.RPCService):
|
|||||||
def _is_valid_ttl(self, context, ttl):
|
def _is_valid_ttl(self, context, ttl):
|
||||||
if ttl is None:
|
if ttl is None:
|
||||||
return
|
return
|
||||||
min_ttl = cfg.CONF['service:central'].min_ttl
|
min_ttl = CONF['service:central'].min_ttl
|
||||||
if min_ttl is not None and ttl < int(min_ttl):
|
if min_ttl is not None and ttl < int(min_ttl):
|
||||||
try:
|
try:
|
||||||
policy.check('use_low_ttl', context)
|
policy.check('use_low_ttl', context)
|
||||||
@ -705,11 +707,11 @@ class Service(service.RPCService):
|
|||||||
maximum val: default_soa_refresh_min
|
maximum val: default_soa_refresh_min
|
||||||
minimum val: default_soa_refresh_max
|
minimum val: default_soa_refresh_max
|
||||||
"""
|
"""
|
||||||
assert cfg.CONF.default_soa_refresh_min is not None
|
assert CONF.default_soa_refresh_min is not None
|
||||||
assert cfg.CONF.default_soa_refresh_max is not None
|
assert CONF.default_soa_refresh_max is not None
|
||||||
dispersion = (cfg.CONF.default_soa_refresh_max -
|
dispersion = (CONF.default_soa_refresh_max -
|
||||||
cfg.CONF.default_soa_refresh_min) * random.random()
|
CONF.default_soa_refresh_min) * random.random()
|
||||||
refresh_time = cfg.CONF.default_soa_refresh_min + dispersion
|
refresh_time = CONF.default_soa_refresh_min + dispersion
|
||||||
return int(refresh_time)
|
return int(refresh_time)
|
||||||
|
|
||||||
def _get_pool_ns_records(self, context, pool_id):
|
def _get_pool_ns_records(self, context, pool_id):
|
||||||
@ -901,7 +903,7 @@ class Service(service.RPCService):
|
|||||||
def get_zone_ns_records(self, context, zone_id=None, criterion=None):
|
def get_zone_ns_records(self, context, zone_id=None, criterion=None):
|
||||||
if zone_id is None:
|
if zone_id is None:
|
||||||
policy.check('get_zone_ns_records', context)
|
policy.check('get_zone_ns_records', context)
|
||||||
pool_id = cfg.CONF['service:central'].default_pool_id
|
pool_id = CONF['service:central'].default_pool_id
|
||||||
else:
|
else:
|
||||||
zone = self.storage.get_zone(context, zone_id)
|
zone = self.storage.get_zone(context, zone_id)
|
||||||
|
|
||||||
@ -1988,8 +1990,8 @@ class Service(service.RPCService):
|
|||||||
zone_values = {
|
zone_values = {
|
||||||
'type': 'PRIMARY',
|
'type': 'PRIMARY',
|
||||||
'name': zone_name,
|
'name': zone_name,
|
||||||
'email': cfg.CONF['service:central'].managed_resource_email,
|
'email': CONF['service:central'].managed_resource_email,
|
||||||
'tenant_id': cfg.CONF['service:central'].managed_resource_tenant_id
|
'tenant_id': CONF['service:central'].managed_resource_tenant_id
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
zone = self.create_zone(
|
zone = self.create_zone(
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_reports import guru_meditation_report as gmr
|
from oslo_reports import guru_meditation_report as gmr
|
||||||
|
|
||||||
@ -28,8 +27,7 @@ from designate import version
|
|||||||
|
|
||||||
|
|
||||||
CONF = designate.conf.CONF
|
CONF = designate.conf.CONF
|
||||||
CONF.import_opt('workers', 'designate.api', group='service:api')
|
CONF.import_group('keystone_authtoken', 'keystonemiddleware.auth_token')
|
||||||
cfg.CONF.import_group('keystone_authtoken', 'keystonemiddleware.auth_token')
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -27,7 +27,6 @@ from designate import version
|
|||||||
|
|
||||||
|
|
||||||
CONF = designate.conf.CONF
|
CONF = designate.conf.CONF
|
||||||
CONF.import_opt('workers', 'designate.central', group='service:central')
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -27,7 +27,6 @@ from designate import version
|
|||||||
|
|
||||||
|
|
||||||
CONF = designate.conf.CONF
|
CONF = designate.conf.CONF
|
||||||
CONF.import_opt('workers', 'designate.mdns', group='service:mdns')
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -25,9 +25,9 @@ from designate import service
|
|||||||
from designate import utils
|
from designate import utils
|
||||||
from designate import version
|
from designate import version
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
CONF = designate.conf.CONF
|
CONF = designate.conf.CONF
|
||||||
CONF.import_opt('workers', 'designate.producer', group='service:producer')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -27,7 +27,6 @@ from designate import version
|
|||||||
|
|
||||||
|
|
||||||
CONF = designate.conf.CONF
|
CONF = designate.conf.CONF
|
||||||
CONF.import_opt('workers', 'designate.sink', group='service:sink')
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -25,9 +25,9 @@ from designate import utils
|
|||||||
from designate import version
|
from designate import version
|
||||||
from designate.worker import service as worker_service
|
from designate.worker import service as worker_service
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
CONF = designate.conf.CONF
|
CONF = designate.conf.CONF
|
||||||
CONF.import_opt('workers', 'designate.worker', group='service:worker')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -10,17 +10,16 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from keystoneauth1 import exceptions as kse
|
from keystoneauth1 import exceptions as kse
|
||||||
from keystoneauth1 import loading as ksa_loading
|
from keystoneauth1 import loading as ksa_loading
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate.i18n import _
|
from designate.i18n import _
|
||||||
|
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,12 +19,12 @@ import sys
|
|||||||
|
|
||||||
from alembic import command as alembic_command
|
from alembic import command as alembic_command
|
||||||
from alembic.config import Config
|
from alembic.config import Config
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate.manage import base
|
from designate.manage import base
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,8 +13,6 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import oslo_messaging as messaging
|
import oslo_messaging as messaging
|
||||||
import stevedore.exception
|
import stevedore.exception
|
||||||
@ -22,6 +20,7 @@ import yaml
|
|||||||
|
|
||||||
from designate.backend import base as backend_base
|
from designate.backend import base as backend_base
|
||||||
from designate.central import rpcapi as central_rpcapi
|
from designate.central import rpcapi as central_rpcapi
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate.manage import base
|
from designate.manage import base
|
||||||
from designate import objects
|
from designate import objects
|
||||||
@ -30,8 +29,9 @@ from designate import policy
|
|||||||
from designate import rpc
|
from designate import rpc
|
||||||
from designate import utils
|
from designate import utils
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
|
|
||||||
class PoolCommands(base.Commands):
|
class PoolCommands(base.Commands):
|
||||||
@ -44,7 +44,7 @@ class PoolCommands(base.Commands):
|
|||||||
def _setup(self, dry_run=False, skip_verify_drivers=False):
|
def _setup(self, dry_run=False, skip_verify_drivers=False):
|
||||||
self.dry_run = dry_run
|
self.dry_run = dry_run
|
||||||
self.skip_verify_drivers = skip_verify_drivers
|
self.skip_verify_drivers = skip_verify_drivers
|
||||||
rpc.init(cfg.CONF)
|
rpc.init(CONF)
|
||||||
self.central_api = central_rpcapi.CentralAPI()
|
self.central_api = central_rpcapi.CentralAPI()
|
||||||
|
|
||||||
@base.args('--file', help='The path to the file the yaml output should be '
|
@base.args('--file', help='The path to the file the yaml output should be '
|
||||||
|
@ -15,17 +15,18 @@
|
|||||||
import csv
|
import csv
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from designate.central import rpcapi as central_rpcapi
|
from designate.central import rpcapi as central_rpcapi
|
||||||
from designate.common import constants
|
from designate.common import constants
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate.manage import base
|
from designate.manage import base
|
||||||
from designate import objects
|
from designate import objects
|
||||||
from designate import rpc
|
from designate import rpc
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -59,7 +60,7 @@ class TLDCommands(base.Commands):
|
|||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
def _startup(self):
|
def _startup(self):
|
||||||
rpc.init(cfg.CONF)
|
rpc.init(CONF)
|
||||||
self.central_api = central_rpcapi.CentralAPI()
|
self.central_api = central_rpcapi.CentralAPI()
|
||||||
|
|
||||||
# The dictionary function __str__() does not list the fields in any
|
# The dictionary function __str__() does not list the fields in any
|
||||||
|
@ -22,18 +22,15 @@ import dns.rdatatype
|
|||||||
import dns.renderer
|
import dns.renderer
|
||||||
import dns.resolver
|
import dns.resolver
|
||||||
import dns.rrset
|
import dns.rrset
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate.worker import rpcapi as worker_api
|
from designate.worker import rpcapi as worker_api
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
CONF.import_opt('default_pool_id', 'designate.central',
|
|
||||||
group='service:central')
|
|
||||||
|
|
||||||
# 10 Bytes of RR metadata, 64 bytes of TSIG RR data, variable length TSIG Key
|
# 10 Bytes of RR metadata, 64 bytes of TSIG RR data, variable length TSIG Key
|
||||||
# name (restricted in designate to 160 chars), 1 byte for trailing dot.
|
# name (restricted in designate to 160 chars), 1 byte for trailing dot.
|
||||||
|
@ -13,9 +13,9 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate.conf.mdns import DEFAULT_MDNS_PORT
|
from designate.conf.mdns import DEFAULT_MDNS_PORT
|
||||||
from designate import dnsmiddleware
|
from designate import dnsmiddleware
|
||||||
from designate import dnsutils
|
from designate import dnsutils
|
||||||
@ -24,8 +24,9 @@ from designate import service
|
|||||||
from designate import storage
|
from designate import storage
|
||||||
from designate import utils
|
from designate import utils
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
|
|
||||||
class Service(service.Service):
|
class Service(service.Service):
|
||||||
@ -35,13 +36,13 @@ class Service(service.Service):
|
|||||||
self._storage = None
|
self._storage = None
|
||||||
|
|
||||||
super().__init__(
|
super().__init__(
|
||||||
self.service_name, threads=cfg.CONF['service:mdns'].threads,
|
self.service_name, threads=CONF['service:mdns'].threads,
|
||||||
)
|
)
|
||||||
self.dns_service = service.DNSService(
|
self.dns_service = service.DNSService(
|
||||||
self.dns_application, self.tg,
|
self.dns_application, self.tg,
|
||||||
cfg.CONF['service:mdns'].listen,
|
CONF['service:mdns'].listen,
|
||||||
cfg.CONF['service:mdns'].tcp_backlog,
|
CONF['service:mdns'].tcp_backlog,
|
||||||
cfg.CONF['service:mdns'].tcp_recv_timeout,
|
CONF['service:mdns'].tcp_recv_timeout,
|
||||||
)
|
)
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
|
@ -14,12 +14,14 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
import eventlet.patcher
|
import eventlet.patcher
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate.plugin import DriverPlugin
|
from designate.plugin import DriverPlugin
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
# NOTE(kiall): This is a workaround for bug #1424621, a broken reimplementation
|
# NOTE(kiall): This is a workaround for bug #1424621, a broken reimplementation
|
||||||
# of eventlet's 0.17.0 monkey patching of dnspython.
|
# of eventlet's 0.17.0 monkey patching of dnspython.
|
||||||
@ -110,7 +112,7 @@ class NetworkAPI(DriverPlugin):
|
|||||||
"""
|
"""
|
||||||
if not config_section:
|
if not config_section:
|
||||||
return None
|
return None
|
||||||
cfg_group = cfg.CONF[config_section]
|
cfg_group = CONF[config_section]
|
||||||
return cfg_group.endpoints
|
return cfg_group.endpoints
|
||||||
|
|
||||||
def list_floatingips(self, context, region=None):
|
def list_floatingips(self, context, region=None):
|
||||||
|
@ -20,14 +20,15 @@ from keystoneauth1 import session
|
|||||||
from keystoneauth1 import token_endpoint
|
from keystoneauth1 import token_endpoint
|
||||||
import openstack
|
import openstack
|
||||||
from openstack import exceptions as sdk_exceptions
|
from openstack import exceptions as sdk_exceptions
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate.network_api import base
|
from designate.network_api import base
|
||||||
from designate import version
|
from designate import version
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,15 +16,17 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
import abc
|
import abc
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from designate.central import rpcapi as central_rpcapi
|
from designate.central import rpcapi as central_rpcapi
|
||||||
|
import designate.conf
|
||||||
from designate.context import DesignateContext
|
from designate.context import DesignateContext
|
||||||
from designate.plugin import ExtensionPlugin
|
from designate.plugin import ExtensionPlugin
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -88,13 +90,13 @@ class BaseAddressHandler(NotificationHandler):
|
|||||||
|
|
||||||
def _get_formatv4(self):
|
def _get_formatv4(self):
|
||||||
return (
|
return (
|
||||||
cfg.CONF[self.name].get('formatv4') or
|
CONF[self.name].get('formatv4') or
|
||||||
self.default_formatv4
|
self.default_formatv4
|
||||||
)
|
)
|
||||||
|
|
||||||
def _get_formatv6(self):
|
def _get_formatv6(self):
|
||||||
return (
|
return (
|
||||||
cfg.CONF[self.name].get('formatv6') or
|
CONF[self.name].get('formatv6') or
|
||||||
self.default_formatv6
|
self.default_formatv6
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -9,11 +9,13 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate.notification_handler import base
|
from designate.notification_handler import base
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -21,12 +23,12 @@ class FakeHandler(base.NotificationHandler):
|
|||||||
__plugin_name__ = 'fake'
|
__plugin_name__ = 'fake'
|
||||||
|
|
||||||
def get_exchange_topics(self):
|
def get_exchange_topics(self):
|
||||||
exchange = cfg.CONF[self.name].control_exchange
|
exchange = CONF[self.name].control_exchange
|
||||||
topics = cfg.CONF[self.name].notification_topics
|
topics = CONF[self.name].notification_topics
|
||||||
return exchange, topics
|
return exchange, topics
|
||||||
|
|
||||||
def get_event_types(self):
|
def get_event_types(self):
|
||||||
return cfg.CONF[self.name].allowed_event_types
|
return CONF[self.name].allowed_event_types
|
||||||
|
|
||||||
def process_notification(self, context, event_type, payload):
|
def process_notification(self, context, event_type, payload):
|
||||||
LOG.info('%s: received notification - %s',
|
LOG.info('%s: received notification - %s',
|
||||||
|
@ -13,12 +13,13 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate.notification_handler import base
|
from designate.notification_handler import base
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -27,9 +28,9 @@ class NeutronFloatingHandler(base.BaseAddressHandler):
|
|||||||
__plugin_name__ = 'neutron_floatingip'
|
__plugin_name__ = 'neutron_floatingip'
|
||||||
|
|
||||||
def get_exchange_topics(self):
|
def get_exchange_topics(self):
|
||||||
exchange = cfg.CONF[self.name].control_exchange
|
exchange = CONF[self.name].control_exchange
|
||||||
|
|
||||||
topics = [topic for topic in cfg.CONF[self.name].notification_topics]
|
topics = [topic for topic in CONF[self.name].notification_topics]
|
||||||
|
|
||||||
return (exchange, topics)
|
return (exchange, topics)
|
||||||
|
|
||||||
@ -43,7 +44,7 @@ class NeutronFloatingHandler(base.BaseAddressHandler):
|
|||||||
LOG.debug('%s received notification - %s',
|
LOG.debug('%s received notification - %s',
|
||||||
self.get_canonical_name(), event_type)
|
self.get_canonical_name(), event_type)
|
||||||
|
|
||||||
zone_id = cfg.CONF[self.name].zone_id
|
zone_id = CONF[self.name].zone_id
|
||||||
|
|
||||||
if not zone_id:
|
if not zone_id:
|
||||||
LOG.error('NeutronFloatingHandler: zone_id is None, '
|
LOG.error('NeutronFloatingHandler: zone_id is None, '
|
||||||
|
@ -13,12 +13,13 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate.notification_handler.base import BaseAddressHandler
|
from designate.notification_handler.base import BaseAddressHandler
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -27,9 +28,9 @@ class NovaFixedHandler(BaseAddressHandler):
|
|||||||
__plugin_name__ = 'nova_fixed'
|
__plugin_name__ = 'nova_fixed'
|
||||||
|
|
||||||
def get_exchange_topics(self):
|
def get_exchange_topics(self):
|
||||||
exchange = cfg.CONF[self.name].control_exchange
|
exchange = CONF[self.name].control_exchange
|
||||||
|
|
||||||
topics = [topic for topic in cfg.CONF[self.name].notification_topics]
|
topics = [topic for topic in CONF[self.name].notification_topics]
|
||||||
|
|
||||||
return (exchange, topics)
|
return (exchange, topics)
|
||||||
|
|
||||||
@ -47,7 +48,7 @@ class NovaFixedHandler(BaseAddressHandler):
|
|||||||
def process_notification(self, context, event_type, payload):
|
def process_notification(self, context, event_type, payload):
|
||||||
LOG.debug('NovaFixedHandler received notification - %s', event_type)
|
LOG.debug('NovaFixedHandler received notification - %s', event_type)
|
||||||
|
|
||||||
zone_id = cfg.CONF[self.name].zone_id
|
zone_id = CONF[self.name].zone_id
|
||||||
|
|
||||||
if not zone_id:
|
if not zone_id:
|
||||||
LOG.error('NovaFixedHandler: zone_id is None, ignore the event.')
|
LOG.error('NovaFixedHandler: zone_id is None, ignore the event.')
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
# Copied: nova.notifications
|
# Copied: nova.notifications
|
||||||
import abc
|
import abc
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
import designate.conf
|
import designate.conf
|
||||||
@ -25,8 +24,9 @@ from designate import objects
|
|||||||
from designate.plugin import DriverPlugin
|
from designate.plugin import DriverPlugin
|
||||||
from designate import rpc
|
from designate import rpc
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
CONF = designate.conf.CONF
|
CONF = designate.conf.CONF
|
||||||
|
LOG = logging.getLogger(__name__)
|
||||||
NOTIFICATION_PLUGIN = None
|
NOTIFICATION_PLUGIN = None
|
||||||
|
|
||||||
|
|
||||||
@ -42,8 +42,8 @@ def send_api_fault(context, url, status, exception):
|
|||||||
|
|
||||||
|
|
||||||
def init_notification_plugin():
|
def init_notification_plugin():
|
||||||
LOG.debug("Loading notification plugin: %s", cfg.CONF.notification_plugin)
|
LOG.debug("Loading notification plugin: %s", CONF.notification_plugin)
|
||||||
cls = NotificationPlugin.get_driver(cfg.CONF.notification_plugin)
|
cls = NotificationPlugin.get_driver(CONF.notification_plugin)
|
||||||
|
|
||||||
global NOTIFICATION_PLUGIN
|
global NOTIFICATION_PLUGIN
|
||||||
NOTIFICATION_PLUGIN = cls()
|
NOTIFICATION_PLUGIN = cls()
|
||||||
|
@ -11,14 +11,15 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
from urllib import parse
|
from urllib import parse
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate.objects.adapters import base
|
from designate.objects.adapters import base
|
||||||
from designate.objects import base as ovoobj_base
|
from designate.objects import base as ovoobj_base
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class APIv2Adapter(base.DesignateAdapter):
|
class APIv2Adapter(base.DesignateAdapter):
|
||||||
|
@ -15,10 +15,10 @@
|
|||||||
|
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
from oslo_versionedobjects import exception as ovo_exc
|
from oslo_versionedobjects import exception as ovo_exc
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate.objects import base
|
from designate.objects import base
|
||||||
from designate.objects import fields
|
from designate.objects import fields
|
||||||
@ -27,10 +27,9 @@ from designate.objects.validation_error import ValidationErrorList
|
|||||||
from designate import utils
|
from designate import utils
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = log.getLogger(__name__)
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
cfg.CONF.import_opt('supported_record_type', 'designate')
|
|
||||||
|
|
||||||
|
|
||||||
@base.DesignateRegistry.register
|
@base.DesignateRegistry.register
|
||||||
class RecordSet(base.DesignateObject, base.DictObjectMixin,
|
class RecordSet(base.DesignateObject, base.DictObjectMixin,
|
||||||
@ -125,7 +124,7 @@ class RecordSet(base.DesignateObject, base.DictObjectMixin,
|
|||||||
% {'type': self.type})
|
% {'type': self.type})
|
||||||
self._validate_fail(errors, err_msg)
|
self._validate_fail(errors, err_msg)
|
||||||
|
|
||||||
if self.type not in cfg.CONF.supported_record_type:
|
if self.type not in CONF.supported_record_type:
|
||||||
err_msg = ("'%(type)s' is not a supported record type"
|
err_msg = ("'%(type)s' is not a supported record type"
|
||||||
% {'type': self.type})
|
% {'type': self.type})
|
||||||
self._validate_fail(errors, err_msg)
|
self._validate_fail(errors, err_msg)
|
||||||
|
@ -15,13 +15,15 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
import abc
|
import abc
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from stevedore import driver
|
from stevedore import driver
|
||||||
from stevedore import enabled
|
from stevedore import enabled
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
|
|
||||||
class Plugin(metaclass=abc.ABCMeta):
|
class Plugin(metaclass=abc.ABCMeta):
|
||||||
|
@ -19,10 +19,11 @@ from oslo_policy import opts
|
|||||||
from oslo_policy import policy
|
from oslo_policy import policy
|
||||||
|
|
||||||
from designate.common import policies
|
from designate.common import policies
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
|
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
# Add the default policy opts
|
# Add the default policy opts
|
||||||
# TODO(gmann): Remove setting the default value of config policy_file
|
# TODO(gmann): Remove setting the default value of config policy_file
|
||||||
@ -45,7 +46,7 @@ def reset():
|
|||||||
|
|
||||||
|
|
||||||
def set_rules(data, default_rule=None, overwrite=True):
|
def set_rules(data, default_rule=None, overwrite=True):
|
||||||
default_rule = default_rule or cfg.CONF.policy_default_rule
|
default_rule = default_rule or CONF.policy_default_rule
|
||||||
if not _ENFORCER:
|
if not _ENFORCER:
|
||||||
LOG.debug("Enforcer not present, recreating at rules stage.")
|
LOG.debug("Enforcer not present, recreating at rules stage.")
|
||||||
init()
|
init()
|
||||||
|
@ -13,19 +13,19 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import oslo_messaging as messaging
|
import oslo_messaging as messaging
|
||||||
|
|
||||||
from designate.central import rpcapi
|
from designate.central import rpcapi
|
||||||
|
import designate.conf
|
||||||
from designate import coordination
|
from designate import coordination
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate.producer import tasks
|
from designate.producer import tasks
|
||||||
from designate import service
|
from designate import service
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
NS = 'designate.periodic_tasks'
|
NS = 'designate.periodic_tasks'
|
||||||
|
|
||||||
@ -42,8 +42,8 @@ class Service(service.RPCService):
|
|||||||
self._quota = None
|
self._quota = None
|
||||||
|
|
||||||
super().__init__(
|
super().__init__(
|
||||||
self.service_name, cfg.CONF['service:producer'].topic,
|
self.service_name, CONF['service:producer'].topic,
|
||||||
threads=cfg.CONF['service:producer'].threads,
|
threads=CONF['service:producer'].threads,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.coordination = coordination.Coordination(
|
self.coordination = coordination.Coordination(
|
||||||
|
@ -15,18 +15,19 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
from oslo_log import log as logging
|
||||||
|
from oslo_utils import timeutils
|
||||||
|
|
||||||
from designate.central import rpcapi
|
from designate.central import rpcapi
|
||||||
|
import designate.conf
|
||||||
from designate import context
|
from designate import context
|
||||||
from designate import plugin
|
from designate import plugin
|
||||||
from designate import rpc
|
from designate import rpc
|
||||||
from designate.worker import rpcapi as worker_rpcapi
|
from designate.worker import rpcapi as worker_rpcapi
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
|
||||||
from oslo_utils import timeutils
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
|
|
||||||
class PeriodicTask(plugin.ExtensionPlugin):
|
class PeriodicTask(plugin.ExtensionPlugin):
|
||||||
|
@ -13,17 +13,18 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate.quota import base
|
from designate.quota import base
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def get_quota():
|
def get_quota():
|
||||||
quota_driver = cfg.CONF.quota_driver
|
quota_driver = CONF.quota_driver
|
||||||
|
|
||||||
LOG.debug("Loading quota driver: %s", quota_driver)
|
LOG.debug("Loading quota driver: %s", quota_driver)
|
||||||
|
|
||||||
|
@ -15,12 +15,14 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
import abc
|
import abc
|
||||||
|
|
||||||
from oslo_config import cfg
|
import designate.conf
|
||||||
|
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate.plugin import DriverPlugin
|
from designate.plugin import DriverPlugin
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class Quota(DriverPlugin, metaclass=abc.ABCMeta):
|
class Quota(DriverPlugin, metaclass=abc.ABCMeta):
|
||||||
"""Base class for quota plugins"""
|
"""Base class for quota plugins"""
|
||||||
__plugin_ns__ = 'designate.quota'
|
__plugin_ns__ = 'designate.quota'
|
||||||
@ -61,11 +63,11 @@ class Quota(DriverPlugin, metaclass=abc.ABCMeta):
|
|||||||
|
|
||||||
def get_default_quotas(self, context):
|
def get_default_quotas(self, context):
|
||||||
return {
|
return {
|
||||||
'zones': cfg.CONF.quota_zones,
|
'zones': CONF.quota_zones,
|
||||||
'zone_recordsets': cfg.CONF.quota_zone_recordsets,
|
'zone_recordsets': CONF.quota_zone_recordsets,
|
||||||
'zone_records': cfg.CONF.quota_zone_records,
|
'zone_records': CONF.quota_zone_records,
|
||||||
'recordset_records': cfg.CONF.quota_recordset_records,
|
'recordset_records': CONF.quota_recordset_records,
|
||||||
'api_export_size': cfg.CONF.quota_api_export_size,
|
'api_export_size': CONF.quota_api_export_size,
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_quota(self, context, tenant_id, resource):
|
def get_quota(self, context, tenant_id, resource):
|
||||||
|
@ -11,17 +11,17 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
import oslo_messaging as messaging
|
import oslo_messaging as messaging
|
||||||
from oslo_messaging.rpc import dispatcher as rpc_dispatcher
|
from oslo_messaging.rpc import dispatcher as rpc_dispatcher
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
from oslo_utils import importutils
|
from oslo_utils import importutils
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
import designate.context
|
import designate.context
|
||||||
import designate.exceptions
|
import designate.exceptions
|
||||||
from designate import objects
|
from designate import objects
|
||||||
|
|
||||||
|
|
||||||
profiler = importutils.try_import('osprofiler.profiler')
|
profiler = importutils.try_import('osprofiler.profiler')
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
@ -37,7 +37,7 @@ __all__ = [
|
|||||||
'get_notifier',
|
'get_notifier',
|
||||||
]
|
]
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
NOTIFICATION_TRANSPORT = None
|
NOTIFICATION_TRANSPORT = None
|
||||||
NOTIFIER = None
|
NOTIFIER = None
|
||||||
TRANSPORT = None
|
TRANSPORT = None
|
||||||
|
@ -11,13 +11,14 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from stevedore import named
|
from stevedore import named
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -31,7 +32,7 @@ class Scheduler:
|
|||||||
"""The list of filters enabled on this scheduler"""
|
"""The list of filters enabled on this scheduler"""
|
||||||
|
|
||||||
def __init__(self, storage):
|
def __init__(self, storage):
|
||||||
enabled_filters = cfg.CONF['service:central'].scheduler_filters
|
enabled_filters = CONF['service:central'].scheduler_filters
|
||||||
self.filters = list()
|
self.filters = list()
|
||||||
self.storage = storage
|
self.storage = storage
|
||||||
|
|
||||||
|
@ -11,12 +11,14 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
import designate.conf
|
||||||
|
|
||||||
from designate import objects
|
from designate import objects
|
||||||
from designate.scheduler.filters import base
|
from designate.scheduler.filters import base
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class DefaultPoolFilter(base.Filter):
|
class DefaultPoolFilter(base.Filter):
|
||||||
"""This filter will always return the default pool specified in the
|
"""This filter will always return the default pool specified in the
|
||||||
designate config file
|
designate config file
|
||||||
@ -36,5 +38,5 @@ class DefaultPoolFilter(base.Filter):
|
|||||||
def filter(self, context, pools, zone):
|
def filter(self, context, pools, zone):
|
||||||
pools = objects.PoolList()
|
pools = objects.PoolList()
|
||||||
pools.append(
|
pools.append(
|
||||||
objects.Pool(id=cfg.CONF['service:central'].default_pool_id))
|
objects.Pool(id=CONF['service:central'].default_pool_id))
|
||||||
return pools
|
return pools
|
||||||
|
@ -11,17 +11,12 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
import designate.conf
|
||||||
from oslo_config import cfg
|
|
||||||
|
|
||||||
from designate import objects
|
from designate import objects
|
||||||
from designate.scheduler.filters import base
|
from designate.scheduler.filters import base
|
||||||
|
|
||||||
cfg.CONF.register_opts([
|
|
||||||
cfg.StrOpt('default_pool_id',
|
CONF = designate.conf.CONF
|
||||||
default='794ccc2c-d751-44fe-b57f-8894c9f5c842',
|
|
||||||
help="The name of the default pool"),
|
|
||||||
], group='service:central')
|
|
||||||
|
|
||||||
|
|
||||||
class FallbackFilter(base.Filter):
|
class FallbackFilter(base.Filter):
|
||||||
@ -43,6 +38,6 @@ class FallbackFilter(base.Filter):
|
|||||||
if not pools:
|
if not pools:
|
||||||
pools = objects.PoolList()
|
pools = objects.PoolList()
|
||||||
pools.append(
|
pools.append(
|
||||||
objects.Pool(id=cfg.CONF['service:central'].default_pool_id)
|
objects.Pool(id=CONF['service:central'].default_pool_id)
|
||||||
)
|
)
|
||||||
return pools
|
return pools
|
||||||
|
@ -11,17 +11,12 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
import designate.conf
|
||||||
from oslo_config import cfg
|
|
||||||
|
|
||||||
from designate import objects
|
from designate import objects
|
||||||
from designate.scheduler.filters import base
|
from designate.scheduler.filters import base
|
||||||
|
|
||||||
cfg.CONF.register_opts([
|
|
||||||
cfg.StrOpt('default_pool_id',
|
CONF = designate.conf.CONF
|
||||||
default='794ccc2c-d751-44fe-b57f-8894c9f5c842',
|
|
||||||
help="The name of the default pool"),
|
|
||||||
], group='service:central')
|
|
||||||
|
|
||||||
|
|
||||||
class InDoubtDefaultPoolFilter(base.Filter):
|
class InDoubtDefaultPoolFilter(base.Filter):
|
||||||
@ -46,7 +41,7 @@ class InDoubtDefaultPoolFilter(base.Filter):
|
|||||||
|
|
||||||
def filter(self, context, pools, zone):
|
def filter(self, context, pools, zone):
|
||||||
if len(pools) > 1:
|
if len(pools) > 1:
|
||||||
default_pool_id = cfg.CONF['service:central'].default_pool_id
|
default_pool_id = CONF['service:central'].default_pool_id
|
||||||
try:
|
try:
|
||||||
default_pool = self.storage.get_pool(context, default_pool_id)
|
default_pool = self.storage.get_pool(context, default_pool_id)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
@ -14,22 +14,23 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import oslo_messaging as messaging
|
import oslo_messaging as messaging
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import notification_handler
|
from designate import notification_handler
|
||||||
from designate import rpc
|
from designate import rpc
|
||||||
from designate import service
|
from designate import service
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Service(service.Service):
|
class Service(service.Service):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__(
|
super().__init__(
|
||||||
self.service_name, threads=cfg.CONF['service:sink'].threads
|
self.service_name, threads=CONF['service:sink'].threads
|
||||||
)
|
)
|
||||||
|
|
||||||
# Initialize extensions
|
# Initialize extensions
|
||||||
@ -45,8 +46,9 @@ class Service(service.Service):
|
|||||||
def _init_extensions():
|
def _init_extensions():
|
||||||
"""Loads and prepares all enabled extensions"""
|
"""Loads and prepares all enabled extensions"""
|
||||||
|
|
||||||
enabled_notification_handlers = cfg.CONF[
|
enabled_notification_handlers = (
|
||||||
'service:sink'].enabled_notification_handlers
|
CONF['service:sink'].enabled_notification_handlers
|
||||||
|
)
|
||||||
|
|
||||||
notification_handlers = notification_handler.get_notification_handlers(
|
notification_handlers = notification_handler.get_notification_handlers(
|
||||||
enabled_notification_handlers)
|
enabled_notification_handlers)
|
||||||
@ -75,7 +77,7 @@ class Service(service.Service):
|
|||||||
if targets:
|
if targets:
|
||||||
self._server = rpc.get_notification_listener(
|
self._server = rpc.get_notification_listener(
|
||||||
targets, [self],
|
targets, [self],
|
||||||
pool=cfg.CONF['service:sink'].listener_pool_name
|
pool=CONF['service:sink'].listener_pool_name
|
||||||
)
|
)
|
||||||
self._server.start()
|
self._server.start()
|
||||||
|
|
||||||
|
@ -27,13 +27,16 @@ from oslo_utils import importutils
|
|||||||
from osprofiler import opts as profiler
|
from osprofiler import opts as profiler
|
||||||
from sqlalchemy import inspect
|
from sqlalchemy import inspect
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
|
|
||||||
|
|
||||||
osprofiler_sqlalchemy = importutils.try_import('osprofiler.sqlalchemy')
|
osprofiler_sqlalchemy = importutils.try_import('osprofiler.sqlalchemy')
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
try:
|
try:
|
||||||
CONF.import_group("profiler", "designate.service")
|
CONF.import_group('profiler', 'designate.service')
|
||||||
except cfg.NoSuchGroupError:
|
except cfg.NoSuchGroupError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -45,7 +48,7 @@ _MAIN_CONTEXT_MANAGER = None
|
|||||||
|
|
||||||
def initialize():
|
def initialize():
|
||||||
"""Initialize the module."""
|
"""Initialize the module."""
|
||||||
connection = cfg.CONF['storage:sqlalchemy'].connection
|
connection = CONF['storage:sqlalchemy'].connection
|
||||||
db_options.set_defaults(
|
db_options.set_defaults(
|
||||||
CONF, connection=connection
|
CONF, connection=connection
|
||||||
)
|
)
|
||||||
|
@ -21,10 +21,10 @@ Create Date: 2022-07-28 23:06:40.731452
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
from alembic import op
|
from alembic import op
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate.conf import central
|
from designate.conf import central
|
||||||
from designate.storage.sqlalchemy.alembic import legacy_utils
|
from designate.storage.sqlalchemy.alembic import legacy_utils
|
||||||
from designate.storage.sqlalchemy.types import UUID
|
from designate.storage.sqlalchemy.types import UUID
|
||||||
@ -37,7 +37,7 @@ depends_on = None
|
|||||||
|
|
||||||
# Equivalent to legacy sqlalchemy-migrate revision 070_liberty
|
# Equivalent to legacy sqlalchemy-migrate revision 070_liberty
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
central.register_opts(CONF)
|
central.register_opts(CONF)
|
||||||
|
|
||||||
ACTIONS = ('CREATE', 'DELETE', 'UPDATE', 'NONE')
|
ACTIONS = ('CREATE', 'DELETE', 'UPDATE', 'NONE')
|
||||||
|
@ -17,15 +17,15 @@ from sqlalchemy import (Table, MetaData, Column, String, Text, Integer,
|
|||||||
SmallInteger, CHAR, DateTime, Enum, Boolean, Unicode,
|
SmallInteger, CHAR, DateTime, Enum, Boolean, Unicode,
|
||||||
UniqueConstraint, ForeignKeyConstraint)
|
UniqueConstraint, ForeignKeyConstraint)
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_db.sqlalchemy import types
|
from oslo_db.sqlalchemy import types
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate.storage.sqlalchemy.types import UUID
|
from designate.storage.sqlalchemy.types import UUID
|
||||||
from designate import utils
|
from designate import utils
|
||||||
|
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
RESOURCE_STATUSES = ['ACTIVE', 'PENDING', 'DELETED', 'ERROR']
|
RESOURCE_STATUSES = ['ACTIVE', 'PENDING', 'DELETED', 'ERROR']
|
||||||
RECORD_TYPES = ['A', 'AAAA', 'CNAME', 'MX', 'SRV', 'TXT', 'SPF', 'NS', 'PTR',
|
RECORD_TYPES = ['A', 'AAAA', 'CNAME', 'MX', 'SRV', 'TXT', 'SPF', 'NS', 'PTR',
|
||||||
|
@ -22,7 +22,6 @@ import time
|
|||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
import eventlet
|
import eventlet
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_messaging import conffixture as messaging_fixture
|
from oslo_messaging import conffixture as messaging_fixture
|
||||||
@ -45,14 +44,6 @@ eventlet.monkey_patch(os=False)
|
|||||||
CONF = designate.conf.CONF
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
CONF.import_opt('auth_strategy', 'designate.api',
|
|
||||||
group='service:api')
|
|
||||||
CONF.import_opt('connection', 'designate.storage.sqlalchemy',
|
|
||||||
group='storage:sqlalchemy')
|
|
||||||
CONF.import_opt('emitter_type', 'designate.heartbeat_emitter',
|
|
||||||
group="heartbeat_emitter")
|
|
||||||
CONF.import_opt('scheduler_filters', 'designate.scheduler',
|
|
||||||
group="service:central")
|
|
||||||
default_pool_id = CONF['service:central'].default_pool_id
|
default_pool_id = CONF['service:central'].default_pool_id
|
||||||
|
|
||||||
_TRUE_VALUES = ('true', '1', 'yes', 'y')
|
_TRUE_VALUES = ('true', '1', 'yes', 'y')
|
||||||
@ -432,7 +423,7 @@ class TestCase(base.BaseTestCase):
|
|||||||
group = kwargs.pop('group', None)
|
group = kwargs.pop('group', None)
|
||||||
|
|
||||||
for k, v in kwargs.items():
|
for k, v in kwargs.items():
|
||||||
cfg.CONF.set_override(k, v, group)
|
CONF.set_override(k, v, group)
|
||||||
|
|
||||||
def policy(self, rules, default_rule='allow', overwrite=True):
|
def policy(self, rules, default_rule='allow', overwrite=True):
|
||||||
# Inject an allow and deny rule
|
# Inject an allow and deny rule
|
||||||
|
@ -28,11 +28,11 @@ import shutil
|
|||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
import fixtures
|
import fixtures
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_utils import importutils
|
from oslo_utils import importutils
|
||||||
import tooz.coordination
|
import tooz.coordination
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate.manage import database as db_commands
|
from designate.manage import database as db_commands
|
||||||
from designate import network_api
|
from designate import network_api
|
||||||
from designate.network_api import fake as fake_network_api
|
from designate.network_api import fake as fake_network_api
|
||||||
@ -44,6 +44,7 @@ import designate.utils
|
|||||||
"""Test fixtures
|
"""Test fixtures
|
||||||
"""
|
"""
|
||||||
_TRUE_VALUES = ('True', 'true', '1', 'yes')
|
_TRUE_VALUES = ('True', 'true', '1', 'yes')
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -170,7 +171,7 @@ class DatabaseFixture(fixtures.Fixture):
|
|||||||
class NetworkAPIFixture(fixtures.Fixture):
|
class NetworkAPIFixture(fixtures.Fixture):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super().setUp()
|
super().setUp()
|
||||||
self.api = network_api.get_network_api(cfg.CONF.network_api)
|
self.api = network_api.get_network_api(CONF.network_api)
|
||||||
self.fake = fake_network_api
|
self.fake = fake_network_api
|
||||||
self.addCleanup(self.fake.reset_floatingips)
|
self.addCleanup(self.fake.reset_floatingips)
|
||||||
|
|
||||||
|
@ -13,12 +13,11 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
import designate.conf
|
||||||
|
|
||||||
from designate.tests.test_api.test_admin import AdminApiTestCase
|
from designate.tests.test_api.test_admin import AdminApiTestCase
|
||||||
|
|
||||||
cfg.CONF.import_opt('enabled_extensions_admin', 'designate.api.admin',
|
|
||||||
group='service:api')
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class AdminApiQuotasTest(AdminApiTestCase):
|
class AdminApiQuotasTest(AdminApiTestCase):
|
||||||
@ -46,8 +45,8 @@ class AdminApiQuotasTest(AdminApiTestCase):
|
|||||||
|
|
||||||
max_zones = response.json['quota']['zones']
|
max_zones = response.json['quota']['zones']
|
||||||
max_zone_records = response.json['quota']['zone_records']
|
max_zone_records = response.json['quota']['zone_records']
|
||||||
self.assertEqual(cfg.CONF.quota_zones, max_zones)
|
self.assertEqual(CONF.quota_zones, max_zones)
|
||||||
self.assertEqual(cfg.CONF.quota_zone_records, max_zone_records)
|
self.assertEqual(CONF.quota_zone_records, max_zone_records)
|
||||||
|
|
||||||
def test_patch_quotas(self):
|
def test_patch_quotas(self):
|
||||||
self.policy({'set_quotas': '@'})
|
self.policy({'set_quotas': '@'})
|
||||||
|
@ -13,13 +13,8 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
|
|
||||||
from designate.tests.test_api.test_admin import AdminApiTestCase
|
from designate.tests.test_api.test_admin import AdminApiTestCase
|
||||||
|
|
||||||
cfg.CONF.import_opt('enabled_extensions_admin', 'designate.api.admin',
|
|
||||||
group='service:api')
|
|
||||||
|
|
||||||
|
|
||||||
class AdminApiReportsTest(AdminApiTestCase):
|
class AdminApiReportsTest(AdminApiTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
@ -16,17 +16,20 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
import oslo_messaging as messaging
|
import oslo_messaging as messaging
|
||||||
from oslo_messaging.notify import notifier
|
from oslo_messaging.notify import notifier
|
||||||
|
|
||||||
from designate.api import middleware
|
from designate.api import middleware
|
||||||
|
import designate.conf
|
||||||
from designate import context
|
from designate import context
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate import rpc
|
from designate import rpc
|
||||||
import designate.tests
|
import designate.tests
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class FakeRequest:
|
class FakeRequest:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.headers = {}
|
self.headers = {}
|
||||||
@ -289,7 +292,7 @@ class FaultMiddlewareTest(designate.tests.TestCase):
|
|||||||
@mock.patch.object(notifier.Notifier, 'error')
|
@mock.patch.object(notifier.Notifier, 'error')
|
||||||
def test_notify_of_fault(self, mock_notifier):
|
def test_notify_of_fault(self, mock_notifier):
|
||||||
self.config(notify_api_faults=True)
|
self.config(notify_api_faults=True)
|
||||||
rpc.init(cfg.CONF)
|
rpc.init(CONF)
|
||||||
app = middleware.FaultWrapperMiddleware({})
|
app = middleware.FaultWrapperMiddleware({})
|
||||||
|
|
||||||
class RaisingRequest(FakeRequest):
|
class RaisingRequest(FakeRequest):
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from dns import zone as dnszone
|
from dns import zone as dnszone
|
||||||
from oslo_config import cfg
|
|
||||||
from webtest import TestApp
|
from webtest import TestApp
|
||||||
|
|
||||||
from designate.api import admin as admin_api
|
from designate.api import admin as admin_api
|
||||||
@ -22,10 +21,6 @@ from designate.api import middleware
|
|||||||
from designate.tests.test_api.test_v2 import ApiV2TestCase
|
from designate.tests.test_api.test_v2 import ApiV2TestCase
|
||||||
|
|
||||||
|
|
||||||
cfg.CONF.import_opt('enabled_extensions_admin', 'designate.api.admin',
|
|
||||||
group='service:api')
|
|
||||||
|
|
||||||
|
|
||||||
class APIV2ZoneImportExportTest(ApiV2TestCase):
|
class APIV2ZoneImportExportTest(ApiV2TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super().setUp()
|
super().setUp()
|
||||||
|
@ -13,11 +13,13 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
import designate.conf
|
||||||
|
|
||||||
from designate.tests.test_api.test_v2 import ApiV2TestCase
|
from designate.tests.test_api.test_v2 import ApiV2TestCase
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class ApiV2LimitsTest(ApiV2TestCase):
|
class ApiV2LimitsTest(ApiV2TestCase):
|
||||||
def test_get_limits(self):
|
def test_get_limits(self):
|
||||||
response = self.client.get('/limits/')
|
response = self.client.get('/limits/')
|
||||||
@ -41,14 +43,14 @@ class ApiV2LimitsTest(ApiV2TestCase):
|
|||||||
|
|
||||||
absolutelimits = response.json
|
absolutelimits = response.json
|
||||||
|
|
||||||
self.assertEqual(cfg.CONF.quota_zones, absolutelimits['max_zones'])
|
self.assertEqual(CONF.quota_zones, absolutelimits['max_zones'])
|
||||||
self.assertEqual(cfg.CONF.quota_zone_records,
|
self.assertEqual(CONF.quota_zone_records,
|
||||||
absolutelimits['max_zone_recordsets'])
|
absolutelimits['max_zone_recordsets'])
|
||||||
self.assertEqual(cfg.CONF['service:central'].min_ttl,
|
self.assertEqual(CONF['service:central'].min_ttl,
|
||||||
absolutelimits['min_ttl'])
|
absolutelimits['min_ttl'])
|
||||||
self.assertEqual(cfg.CONF['service:central'].max_zone_name_len,
|
self.assertEqual(CONF['service:central'].max_zone_name_len,
|
||||||
absolutelimits['max_zone_name_length'])
|
absolutelimits['max_zone_name_length'])
|
||||||
self.assertEqual(cfg.CONF['service:central'].max_recordset_name_len,
|
self.assertEqual(CONF['service:central'].max_recordset_name_len,
|
||||||
absolutelimits['max_recordset_name_length'])
|
absolutelimits['max_recordset_name_length'])
|
||||||
self.assertEqual(cfg.CONF['service:api'].max_limit_v2,
|
self.assertEqual(CONF['service:api'].max_limit_v2,
|
||||||
absolutelimits['max_page_limit'])
|
absolutelimits['max_page_limit'])
|
||||||
|
@ -12,11 +12,13 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate.tests.test_api.test_v2 import ApiV2TestCase
|
from designate.tests.test_api.test_v2 import ApiV2TestCase
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -160,7 +162,7 @@ class ApiV2PoolsTest(ApiV2TestCase):
|
|||||||
self.assertEqual(1, len(response.json['pools']))
|
self.assertEqual(1, len(response.json['pools']))
|
||||||
|
|
||||||
# GET the default pool
|
# GET the default pool
|
||||||
pool_id = cfg.CONF['service:central'].default_pool_id
|
pool_id = CONF['service:central'].default_pool_id
|
||||||
default_pool = self.central_service.get_pool(self.admin_context,
|
default_pool = self.central_service.get_pool(self.admin_context,
|
||||||
pool_id)
|
pool_id)
|
||||||
|
|
||||||
|
@ -16,16 +16,19 @@
|
|||||||
from unittest import mock
|
from unittest import mock
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
import oslo_messaging as messaging
|
import oslo_messaging as messaging
|
||||||
|
|
||||||
from designate.central import service as central_service
|
from designate.central import service as central_service
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate import objects
|
from designate import objects
|
||||||
from designate.tests.test_api.test_v2 import ApiV2TestCase
|
from designate.tests.test_api.test_v2 import ApiV2TestCase
|
||||||
from designate.worker import rpcapi as worker_api
|
from designate.worker import rpcapi as worker_api
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class ApiV2ZonesTest(ApiV2TestCase):
|
class ApiV2ZonesTest(ApiV2TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super().setUp()
|
super().setUp()
|
||||||
@ -541,7 +544,7 @@ class ApiV2ZonesTest(ApiV2TestCase):
|
|||||||
self.assertIn('id', response.json)
|
self.assertIn('id', response.json)
|
||||||
self.assertIn('created_at', response.json)
|
self.assertIn('created_at', response.json)
|
||||||
self.assertEqual('PENDING', response.json['status'])
|
self.assertEqual('PENDING', response.json['status'])
|
||||||
self.assertEqual(cfg.CONF['service:central'].managed_resource_email,
|
self.assertEqual(CONF['service:central'].managed_resource_email,
|
||||||
response.json['email'])
|
response.json['email'])
|
||||||
|
|
||||||
self.assertIsNone(response.json['updated_at'])
|
self.assertIsNone(response.json['updated_at'])
|
||||||
@ -571,7 +574,7 @@ class ApiV2ZonesTest(ApiV2TestCase):
|
|||||||
{'host': '192.0.2.2', 'port': 69}
|
{'host': '192.0.2.2', 'port': 69}
|
||||||
])
|
])
|
||||||
)
|
)
|
||||||
zone.email = cfg.CONF['service:central'].managed_resource_email
|
zone.email = CONF['service:central'].managed_resource_email
|
||||||
|
|
||||||
# Create a zone
|
# Create a zone
|
||||||
zone = self.central_service.create_zone(self.admin_context, zone)
|
zone = self.central_service.create_zone(self.admin_context, zone)
|
||||||
@ -603,7 +606,7 @@ class ApiV2ZonesTest(ApiV2TestCase):
|
|||||||
def test_xfr_request(self):
|
def test_xfr_request(self):
|
||||||
# Create a zone
|
# Create a zone
|
||||||
fixture = self.get_zone_fixture('SECONDARY', 0)
|
fixture = self.get_zone_fixture('SECONDARY', 0)
|
||||||
fixture['email'] = cfg.CONF['service:central'].managed_resource_email
|
fixture['email'] = CONF['service:central'].managed_resource_email
|
||||||
fixture['masters'] = [{"host": "192.0.2.10", "port": 53}]
|
fixture['masters'] = [{"host": "192.0.2.10", "port": 53}]
|
||||||
|
|
||||||
# Create a zone
|
# Create a zone
|
||||||
@ -641,7 +644,7 @@ class ApiV2ZonesTest(ApiV2TestCase):
|
|||||||
def test_update_secondary_email_invalid_object(self):
|
def test_update_secondary_email_invalid_object(self):
|
||||||
# Create a zone
|
# Create a zone
|
||||||
fixture = self.get_zone_fixture('SECONDARY', 0)
|
fixture = self.get_zone_fixture('SECONDARY', 0)
|
||||||
fixture['email'] = cfg.CONF['service:central'].managed_resource_email
|
fixture['email'] = CONF['service:central'].managed_resource_email
|
||||||
|
|
||||||
# Create a zone
|
# Create a zone
|
||||||
zone = self.create_zone(**fixture)
|
zone = self.create_zone(**fixture)
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from concurrent import futures
|
from concurrent import futures
|
||||||
import copy
|
import copy
|
||||||
@ -24,7 +23,6 @@ import random
|
|||||||
import unittest
|
import unittest
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
from oslo_db import exception as db_exception
|
from oslo_db import exception as db_exception
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
@ -35,6 +33,7 @@ from oslo_versionedobjects import exception as ovo_exc
|
|||||||
import testtools
|
import testtools
|
||||||
|
|
||||||
from designate.common import constants
|
from designate.common import constants
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate import objects
|
from designate import objects
|
||||||
from designate.storage import sql
|
from designate.storage import sql
|
||||||
@ -44,6 +43,8 @@ from designate.tests import fixtures
|
|||||||
from designate import utils
|
from designate import utils
|
||||||
from designate.worker import rpcapi as worker_api
|
from designate.worker import rpcapi as worker_api
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -942,7 +943,7 @@ class CentralServiceTest(designate.tests.TestCase):
|
|||||||
|
|
||||||
def test_update_zone_master_for_secondary_zone(self):
|
def test_update_zone_master_for_secondary_zone(self):
|
||||||
fixture = self.get_zone_fixture('SECONDARY', 0)
|
fixture = self.get_zone_fixture('SECONDARY', 0)
|
||||||
fixture['email'] = cfg.CONF['service:central'].managed_resource_email
|
fixture['email'] = CONF['service:central'].managed_resource_email
|
||||||
fixture['masters'] = [{'host': '192.0.2.10', 'port': 53}]
|
fixture['masters'] = [{'host': '192.0.2.10', 'port': 53}]
|
||||||
|
|
||||||
# Create a zone
|
# Create a zone
|
||||||
@ -1447,7 +1448,7 @@ class CentralServiceTest(designate.tests.TestCase):
|
|||||||
def test_xfr_zone(self):
|
def test_xfr_zone(self):
|
||||||
# Create a zone
|
# Create a zone
|
||||||
fixture = self.get_zone_fixture('SECONDARY', 0)
|
fixture = self.get_zone_fixture('SECONDARY', 0)
|
||||||
fixture['email'] = cfg.CONF['service:central'].managed_resource_email
|
fixture['email'] = CONF['service:central'].managed_resource_email
|
||||||
fixture['masters'] = [{"host": "192.0.2.10", "port": 53}]
|
fixture['masters'] = [{"host": "192.0.2.10", "port": 53}]
|
||||||
|
|
||||||
# Create a zone
|
# Create a zone
|
||||||
@ -1466,7 +1467,7 @@ class CentralServiceTest(designate.tests.TestCase):
|
|||||||
def test_xfr_zone_same_serial(self):
|
def test_xfr_zone_same_serial(self):
|
||||||
# Create a zone
|
# Create a zone
|
||||||
fixture = self.get_zone_fixture('SECONDARY', 0)
|
fixture = self.get_zone_fixture('SECONDARY', 0)
|
||||||
fixture['email'] = cfg.CONF['service:central'].managed_resource_email
|
fixture['email'] = CONF['service:central'].managed_resource_email
|
||||||
fixture['masters'] = [{"host": "192.0.2.10", "port": 53}]
|
fixture['masters'] = [{"host": "192.0.2.10", "port": 53}]
|
||||||
|
|
||||||
# Create a zone
|
# Create a zone
|
||||||
@ -1484,7 +1485,7 @@ class CentralServiceTest(designate.tests.TestCase):
|
|||||||
def test_xfr_zone_lower_serial(self):
|
def test_xfr_zone_lower_serial(self):
|
||||||
# Create a zone
|
# Create a zone
|
||||||
fixture = self.get_zone_fixture('SECONDARY', 0)
|
fixture = self.get_zone_fixture('SECONDARY', 0)
|
||||||
fixture['email'] = cfg.CONF['service:central'].managed_resource_email
|
fixture['email'] = CONF['service:central'].managed_resource_email
|
||||||
fixture['masters'] = [{"host": "192.0.2.10", "port": 53}]
|
fixture['masters'] = [{"host": "192.0.2.10", "port": 53}]
|
||||||
fixture['serial'] = 10
|
fixture['serial'] = 10
|
||||||
|
|
||||||
@ -1573,8 +1574,8 @@ class CentralServiceTest(designate.tests.TestCase):
|
|||||||
# Create the Object
|
# Create the Object
|
||||||
recordset = objects.RecordSet(name='www.%s' % zone.name, type='A')
|
recordset = objects.RecordSet(name='www.%s' % zone.name, type='A')
|
||||||
|
|
||||||
self.useFixture(cfg_fixture.Config(cfg.CONF))
|
self.useFixture(cfg_fixture.Config(CONF))
|
||||||
cfg.CONF.set_override('enforce_new_defaults', True, 'oslo_policy')
|
CONF.set_override('enforce_new_defaults', True, 'oslo_policy')
|
||||||
context = self.get_context(project_id='1', roles=['member', 'reader'])
|
context = self.get_context(project_id='1', roles=['member', 'reader'])
|
||||||
|
|
||||||
self.share_zone(context=self.admin_context, zone_id=zone.id,
|
self.share_zone(context=self.admin_context, zone_id=zone.id,
|
||||||
@ -3854,7 +3855,7 @@ class CentralServiceTest(designate.tests.TestCase):
|
|||||||
self.assertEqual('foo', result.message)
|
self.assertEqual('foo', result.message)
|
||||||
|
|
||||||
def test_create_ptr_zone(self):
|
def test_create_ptr_zone(self):
|
||||||
cfg.CONF.set_override(
|
CONF.set_override(
|
||||||
'managed_resource_tenant_id',
|
'managed_resource_tenant_id',
|
||||||
self.admin_context.project_id,
|
self.admin_context.project_id,
|
||||||
'service:central'
|
'service:central'
|
||||||
@ -3869,7 +3870,7 @@ class CentralServiceTest(designate.tests.TestCase):
|
|||||||
self.assertEqual('example.org.', zones[0]['name'])
|
self.assertEqual('example.org.', zones[0]['name'])
|
||||||
|
|
||||||
def test_create_duplicate_ptr_zone(self):
|
def test_create_duplicate_ptr_zone(self):
|
||||||
cfg.CONF.set_override(
|
CONF.set_override(
|
||||||
'managed_resource_tenant_id',
|
'managed_resource_tenant_id',
|
||||||
self.admin_context.project_id,
|
self.admin_context.project_id,
|
||||||
'service:central'
|
'service:central'
|
||||||
@ -4035,8 +4036,8 @@ class CentralServiceTest(designate.tests.TestCase):
|
|||||||
|
|
||||||
def test_share_zone_new_policy_defaults(self):
|
def test_share_zone_new_policy_defaults(self):
|
||||||
# Configure designate for enforcing the new policy defaults
|
# Configure designate for enforcing the new policy defaults
|
||||||
self.useFixture(cfg_fixture.Config(cfg.CONF))
|
self.useFixture(cfg_fixture.Config(CONF))
|
||||||
cfg.CONF.set_override('enforce_new_defaults', True, 'oslo_policy')
|
CONF.set_override('enforce_new_defaults', True, 'oslo_policy')
|
||||||
context = self.get_context(project_id='1', roles=['member', 'reader'])
|
context = self.get_context(project_id='1', roles=['member', 'reader'])
|
||||||
|
|
||||||
# Create a Shared Zone
|
# Create a Shared Zone
|
||||||
@ -4077,8 +4078,8 @@ class CentralServiceTest(designate.tests.TestCase):
|
|||||||
|
|
||||||
def test_unshare_zone_new_policy_defaults(self):
|
def test_unshare_zone_new_policy_defaults(self):
|
||||||
# Configure designate for enforcing the new policy defaults
|
# Configure designate for enforcing the new policy defaults
|
||||||
self.useFixture(cfg_fixture.Config(cfg.CONF))
|
self.useFixture(cfg_fixture.Config(CONF))
|
||||||
cfg.CONF.set_override('enforce_new_defaults', True, 'oslo_policy')
|
CONF.set_override('enforce_new_defaults', True, 'oslo_policy')
|
||||||
context = self.get_context(project_id='1', roles=['member', 'reader'])
|
context = self.get_context(project_id='1', roles=['member', 'reader'])
|
||||||
|
|
||||||
# Create a Shared Zone
|
# Create a Shared Zone
|
||||||
@ -4178,8 +4179,8 @@ class CentralServiceTest(designate.tests.TestCase):
|
|||||||
context=context, zone_id=zone.id, target_project_id="second_tenant"
|
context=context, zone_id=zone.id, target_project_id="second_tenant"
|
||||||
)
|
)
|
||||||
|
|
||||||
self.useFixture(cfg_fixture.Config(cfg.CONF))
|
self.useFixture(cfg_fixture.Config(CONF))
|
||||||
cfg.CONF.set_override('enforce_new_defaults', True, 'oslo_policy')
|
CONF.set_override('enforce_new_defaults', True, 'oslo_policy')
|
||||||
|
|
||||||
# Ensure we can retrieve both shared_zones
|
# Ensure we can retrieve both shared_zones
|
||||||
shared_zones = self.central_service.find_shared_zones(
|
shared_zones = self.central_service.find_shared_zones(
|
||||||
|
@ -14,15 +14,15 @@ from unittest import mock
|
|||||||
import dns
|
import dns
|
||||||
import dns.query
|
import dns.query
|
||||||
import dns.tsigkeyring
|
import dns.tsigkeyring
|
||||||
from oslo_config import cfg
|
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import dnsmiddleware
|
from designate import dnsmiddleware
|
||||||
from designate import dnsutils
|
from designate import dnsutils
|
||||||
from designate.mdns import handler
|
from designate.mdns import handler
|
||||||
from designate import storage
|
from designate import storage
|
||||||
import designate.tests
|
import designate.tests
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class TestSerializationMiddleware(designate.tests.TestCase):
|
class TestSerializationMiddleware(designate.tests.TestCase):
|
||||||
|
@ -16,15 +16,15 @@
|
|||||||
import dns
|
import dns
|
||||||
import dns.query
|
import dns.query
|
||||||
import dns.tsigkeyring
|
import dns.tsigkeyring
|
||||||
from oslo_config import cfg
|
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import dnsutils
|
from designate import dnsutils
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate import objects
|
from designate import objects
|
||||||
from designate import storage
|
from designate import storage
|
||||||
import designate.tests
|
import designate.tests
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
SAMPLES = {
|
SAMPLES = {
|
||||||
("cname.example.com.", "CNAME"): {
|
("cname.example.com.", "CNAME"): {
|
||||||
"ttl": 10800,
|
"ttl": 10800,
|
||||||
|
@ -22,15 +22,16 @@ import dns.rdatatype
|
|||||||
import dns.resolver
|
import dns.resolver
|
||||||
import dns.rrset
|
import dns.rrset
|
||||||
import dns.tsigkeyring
|
import dns.tsigkeyring
|
||||||
from oslo_config import cfg
|
|
||||||
import testtools
|
import testtools
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import context
|
from designate import context
|
||||||
from designate.mdns import handler
|
from designate.mdns import handler
|
||||||
from designate import objects
|
from designate import objects
|
||||||
import designate.tests
|
import designate.tests
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
default_pool_id = CONF['service:central'].default_pool_id
|
default_pool_id = CONF['service:central'].default_pool_id
|
||||||
|
|
||||||
ANSWER = [
|
ANSWER = [
|
||||||
@ -127,7 +128,7 @@ class MdnsRequestHandlerTest(designate.tests.TestCase):
|
|||||||
attributes = attributes or []
|
attributes = attributes or []
|
||||||
masters = masters or [{"host": "192.0.2.1", "port": 53}]
|
masters = masters or [{"host": "192.0.2.1", "port": 53}]
|
||||||
fixture = self.get_zone_fixture("SECONDARY", values=values)
|
fixture = self.get_zone_fixture("SECONDARY", values=values)
|
||||||
fixture['email'] = cfg.CONF['service:central'].managed_resource_email
|
fixture['email'] = CONF['service:central'].managed_resource_email
|
||||||
|
|
||||||
zone = objects.Zone(**fixture)
|
zone = objects.Zone(**fixture)
|
||||||
zone.attributes = objects.ZoneAttributeList().from_list(attributes)
|
zone.attributes = objects.ZoneAttributeList().from_list(attributes)
|
||||||
|
@ -15,14 +15,15 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import testscenarios
|
import testscenarios
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate import quota
|
from designate import quota
|
||||||
import designate.tests
|
import designate.tests
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
load_tests = testscenarios.load_tests_apply_scenarios
|
load_tests = testscenarios.load_tests_apply_scenarios
|
||||||
|
|
||||||
@ -45,11 +46,11 @@ class QuotaTestCase(designate.tests.TestCase):
|
|||||||
|
|
||||||
self.assertIsNotNone(quotas)
|
self.assertIsNotNone(quotas)
|
||||||
self.assertEqual({
|
self.assertEqual({
|
||||||
'api_export_size': cfg.CONF.quota_api_export_size,
|
'api_export_size': CONF.quota_api_export_size,
|
||||||
'zones': cfg.CONF.quota_zones,
|
'zones': CONF.quota_zones,
|
||||||
'zone_recordsets': cfg.CONF.quota_zone_recordsets,
|
'zone_recordsets': CONF.quota_zone_recordsets,
|
||||||
'zone_records': cfg.CONF.quota_zone_records,
|
'zone_records': CONF.quota_zone_records,
|
||||||
'recordset_records': cfg.CONF.quota_recordset_records,
|
'recordset_records': CONF.quota_recordset_records,
|
||||||
}, quotas)
|
}, quotas)
|
||||||
|
|
||||||
def test_limit_check_unknown(self):
|
def test_limit_check_unknown(self):
|
||||||
@ -78,11 +79,11 @@ class QuotaTestCase(designate.tests.TestCase):
|
|||||||
zone_records=0)
|
zone_records=0)
|
||||||
|
|
||||||
self.quota.limit_check(context, 'tenant_id',
|
self.quota.limit_check(context, 'tenant_id',
|
||||||
zones=(cfg.CONF.quota_zones - 1))
|
zones=(CONF.quota_zones - 1))
|
||||||
self.quota.limit_check(
|
self.quota.limit_check(
|
||||||
context,
|
context,
|
||||||
'tenant_id',
|
'tenant_id',
|
||||||
zone_records=(cfg.CONF.quota_zone_records - 1))
|
zone_records=(CONF.quota_zone_records - 1))
|
||||||
|
|
||||||
def test_limit_check_at(self):
|
def test_limit_check_at(self):
|
||||||
context = self.get_admin_context()
|
context = self.get_admin_context()
|
||||||
@ -90,13 +91,13 @@ class QuotaTestCase(designate.tests.TestCase):
|
|||||||
self.assertRaisesRegex(
|
self.assertRaisesRegex(
|
||||||
exceptions.OverQuota, 'Quota exceeded for zones\\.',
|
exceptions.OverQuota, 'Quota exceeded for zones\\.',
|
||||||
self.quota.limit_check,
|
self.quota.limit_check,
|
||||||
context, 'tenant_id', zones=cfg.CONF.quota_zones + 1
|
context, 'tenant_id', zones=CONF.quota_zones + 1
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertRaisesRegex(
|
self.assertRaisesRegex(
|
||||||
exceptions.OverQuota, 'Quota exceeded for zone_records\\.',
|
exceptions.OverQuota, 'Quota exceeded for zone_records\\.',
|
||||||
self.quota.limit_check,
|
self.quota.limit_check,
|
||||||
context, 'tenant_id', zone_records=cfg.CONF.quota_zone_records + 1
|
context, 'tenant_id', zone_records=CONF.quota_zone_records + 1
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_limit_check_unlimited(self):
|
def test_limit_check_unlimited(self):
|
||||||
|
@ -17,10 +17,10 @@ import math
|
|||||||
from sqlalchemy import text
|
from sqlalchemy import text
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_messaging.rpc import dispatcher as rpc_dispatcher
|
from oslo_messaging.rpc import dispatcher as rpc_dispatcher
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate.conf.mdns import DEFAULT_MDNS_PORT
|
from designate.conf.mdns import DEFAULT_MDNS_PORT
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate import objects
|
from designate import objects
|
||||||
@ -29,6 +29,8 @@ from designate.storage import sql
|
|||||||
from designate.tests import TestCase
|
from designate.tests import TestCase
|
||||||
from designate.utils import generate_uuid
|
from designate.utils import generate_uuid
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -651,7 +653,7 @@ class SqlalchemyStorageTest(TestCase):
|
|||||||
|
|
||||||
# Zone Tests
|
# Zone Tests
|
||||||
def test_create_zone(self):
|
def test_create_zone(self):
|
||||||
pool_id = cfg.CONF['service:central'].default_pool_id
|
pool_id = CONF['service:central'].default_pool_id
|
||||||
values = {
|
values = {
|
||||||
'tenant_id': self.admin_context.project_id,
|
'tenant_id': self.admin_context.project_id,
|
||||||
'name': 'example.net.',
|
'name': 'example.net.',
|
||||||
|
@ -10,16 +10,16 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
import webtest
|
import webtest
|
||||||
|
|
||||||
from designate.api import versions
|
from designate.api import versions
|
||||||
from designate.common import constants
|
from designate.common import constants
|
||||||
|
import designate.conf
|
||||||
|
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class TestApiVersion(oslotest.base.BaseTestCase):
|
class TestApiVersion(oslotest.base.BaseTestCase):
|
||||||
|
@ -10,15 +10,15 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from designate.api import wsgi
|
from designate.api import wsgi
|
||||||
|
import designate.conf
|
||||||
|
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class TestApiWsgi(oslotest.base.BaseTestCase):
|
class TestApiWsgi(oslotest.base.BaseTestCase):
|
||||||
|
@ -12,19 +12,19 @@
|
|||||||
|
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
|
|
||||||
from designate.central import service
|
from designate.central import service
|
||||||
from designate.common import profiler
|
from designate.common import profiler
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate.objects import record
|
from designate.objects import record
|
||||||
from designate.objects import zone
|
from designate.objects import zone
|
||||||
from designate import policy
|
from designate import policy
|
||||||
from designate import rpc
|
from designate import rpc
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class CentralTestCase(oslotest.base.BaseTestCase):
|
class CentralTestCase(oslotest.base.BaseTestCase):
|
||||||
|
@ -9,10 +9,8 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
@ -22,8 +20,10 @@ from designate.cmd import mdns
|
|||||||
from designate.cmd import producer
|
from designate.cmd import producer
|
||||||
from designate.cmd import sink
|
from designate.cmd import sink
|
||||||
from designate.cmd import worker
|
from designate.cmd import worker
|
||||||
|
import designate.conf
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
@mock.patch('designate.service.wait')
|
@mock.patch('designate.service.wait')
|
||||||
|
@ -12,14 +12,15 @@
|
|||||||
import sys
|
import sys
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
from designate.cmd import manage
|
from designate.cmd import manage
|
||||||
|
import designate.conf
|
||||||
from designate.manage import base
|
from designate.manage import base
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class ManageTestCase(oslotest.base.BaseTestCase):
|
class ManageTestCase(oslotest.base.BaseTestCase):
|
||||||
|
@ -16,18 +16,19 @@
|
|||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
import dns
|
import dns
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
from oslo_messaging import conffixture as messaging_fixture
|
from oslo_messaging import conffixture as messaging_fixture
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate.mdns import handler
|
from designate.mdns import handler
|
||||||
from designate import objects
|
from designate import objects
|
||||||
from designate.tests import fixtures
|
from designate.tests import fixtures
|
||||||
from designate.worker import rpcapi as worker_rpcapi
|
from designate.worker import rpcapi as worker_rpcapi
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class MdnsHandleTest(oslotest.base.BaseTestCase):
|
class MdnsHandleTest(oslotest.base.BaseTestCase):
|
||||||
|
@ -15,10 +15,10 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import dnsmiddleware
|
from designate import dnsmiddleware
|
||||||
from designate.mdns import handler
|
from designate.mdns import handler
|
||||||
from designate.mdns import service
|
from designate.mdns import service
|
||||||
@ -27,7 +27,8 @@ from designate import storage
|
|||||||
from designate.tests import fixtures
|
from designate.tests import fixtures
|
||||||
import designate.utils
|
import designate.utils
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class MdnsServiceTest(oslotest.base.BaseTestCase):
|
class MdnsServiceTest(oslotest.base.BaseTestCase):
|
||||||
|
@ -9,13 +9,15 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.mport threading
|
# under the License.mport threading
|
||||||
import designate.exceptions
|
|
||||||
from designate.network_api import base
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
CONF = cfg.CONF
|
import designate.conf
|
||||||
|
import designate.exceptions
|
||||||
|
from designate.network_api import base
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
SERVICE_CATALOG = [
|
SERVICE_CATALOG = [
|
||||||
{
|
{
|
||||||
@ -149,7 +151,7 @@ class NetworkEndpointsFromConfigTest(oslotest.base.BaseTestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
result = self.base.endpoints_from_config(
|
result = self.base.endpoints_from_config(
|
||||||
cfg.CONF['network_api:neutron'].endpoints,
|
CONF['network_api:neutron'].endpoints,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
@ -163,7 +165,7 @@ class NetworkEndpointsFromConfigTest(oslotest.base.BaseTestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
result = self.base.endpoints_from_config(
|
result = self.base.endpoints_from_config(
|
||||||
cfg.CONF['network_api:neutron'].endpoints,
|
CONF['network_api:neutron'].endpoints,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
@ -177,7 +179,7 @@ class NetworkEndpointsFromConfigTest(oslotest.base.BaseTestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
result = self.base.endpoints_from_config(
|
result = self.base.endpoints_from_config(
|
||||||
cfg.CONF['network_api:neutron'].endpoints,
|
CONF['network_api:neutron'].endpoints,
|
||||||
region='RegionFour',
|
region='RegionFour',
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -195,7 +197,7 @@ class NetworkEndpointsFromConfigTest(oslotest.base.BaseTestCase):
|
|||||||
designate.exceptions.ConfigurationError,
|
designate.exceptions.ConfigurationError,
|
||||||
'Endpoints are not correctly configured',
|
'Endpoints are not correctly configured',
|
||||||
self.base.endpoints_from_config,
|
self.base.endpoints_from_config,
|
||||||
cfg.CONF['network_api:neutron'].endpoints,
|
CONF['network_api:neutron'].endpoints,
|
||||||
region='RegionFive',
|
region='RegionFive',
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -209,7 +211,7 @@ class NetworkEndpointsFromConfigTest(oslotest.base.BaseTestCase):
|
|||||||
designate.exceptions.ConfigurationError,
|
designate.exceptions.ConfigurationError,
|
||||||
'Endpoints are not correctly configured',
|
'Endpoints are not correctly configured',
|
||||||
self.base.endpoints_from_config,
|
self.base.endpoints_from_config,
|
||||||
cfg.CONF['network_api:neutron'].endpoints,
|
CONF['network_api:neutron'].endpoints,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,17 +16,18 @@
|
|||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from openstack import exceptions as sdk_exceptions
|
from openstack import exceptions as sdk_exceptions
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import context
|
from designate import context
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate.network_api import get_network_api
|
from designate.network_api import get_network_api
|
||||||
from designate.network_api import neutron
|
from designate.network_api import neutron
|
||||||
from designate import version
|
from designate import version
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class NeutronNetworkAPITest(oslotest.base.BaseTestCase):
|
class NeutronNetworkAPITest(oslotest.base.BaseTestCase):
|
||||||
|
@ -11,13 +11,14 @@
|
|||||||
# under the License.mport threading
|
# under the License.mport threading
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate.notification_handler import fake
|
from designate.notification_handler import fake
|
||||||
from designate.tests import test_notification_handler
|
from designate.tests import test_notification_handler
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class TestFakeHandler(oslotest.base.BaseTestCase,
|
class TestFakeHandler(oslotest.base.BaseTestCase,
|
||||||
|
@ -15,17 +15,18 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate import objects
|
from designate import objects
|
||||||
from designate.objects import adapters
|
from designate.objects import adapters
|
||||||
from designate.objects.adapters.api_v2 import base
|
from designate.objects.adapters.api_v2 import base
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,16 +16,18 @@
|
|||||||
import itertools
|
import itertools
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate import objects
|
from designate import objects
|
||||||
from designate.objects.adapters import DesignateAdapter
|
from designate.objects.adapters import DesignateAdapter
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,16 +20,17 @@ Unit-test Producer service
|
|||||||
|
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate.producer import service
|
from designate.producer import service
|
||||||
import designate.service
|
import designate.service
|
||||||
from designate.tests import fixtures
|
from designate.tests import fixtures
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
@mock.patch.object(service.rpcapi.CentralAPI, 'get_instance', mock.Mock())
|
@mock.patch.object(service.rpcapi.CentralAPI, 'get_instance', mock.Mock())
|
||||||
|
@ -27,6 +27,7 @@ from oslo_utils import timeutils
|
|||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
from designate.central import rpcapi as central_api
|
from designate.central import rpcapi as central_api
|
||||||
|
import designate.conf
|
||||||
from designate import context
|
from designate import context
|
||||||
from designate.producer import tasks
|
from designate.producer import tasks
|
||||||
from designate import rpc
|
from designate import rpc
|
||||||
@ -44,7 +45,7 @@ DUMMY_TASK_OPTS = [
|
|||||||
help='Default amount of results returned per page'),
|
help='Default amount of results returned per page'),
|
||||||
]
|
]
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
CONF.register_group(DUMMY_TASK_GROUP)
|
CONF.register_group(DUMMY_TASK_GROUP)
|
||||||
CONF.register_opts(DUMMY_TASK_OPTS, group=DUMMY_TASK_GROUP)
|
CONF.register_opts(DUMMY_TASK_OPTS, group=DUMMY_TASK_GROUP)
|
||||||
|
|
||||||
|
@ -11,14 +11,17 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate import objects
|
from designate import objects
|
||||||
from designate import scheduler
|
from designate import scheduler
|
||||||
from designate import tests
|
from designate import tests
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
DEFAULT_POOL_ID = BRONZE_POOL_ID = '67d71c2a-645c-4dde-a6b8-60a172c9ede8'
|
DEFAULT_POOL_ID = BRONZE_POOL_ID = '67d71c2a-645c-4dde-a6b8-60a172c9ede8'
|
||||||
SILVER_POOL_ID = '5fabcd37-262c-4cf3-8625-7f419434b6df'
|
SILVER_POOL_ID = '5fabcd37-262c-4cf3-8625-7f419434b6df'
|
||||||
GOLD_POOL_ID = '24702e43-8a52-440f-ab74-19fc16048860'
|
GOLD_POOL_ID = '24702e43-8a52-440f-ab74-19fc16048860'
|
||||||
@ -64,7 +67,7 @@ def build_test_pools():
|
|||||||
class AttributeSchedulerPermutationsTest(tests.TestCase):
|
class AttributeSchedulerPermutationsTest(tests.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super().setUp()
|
super().setUp()
|
||||||
self.CONF = self.useFixture(cfg_fixture.Config(cfg.CONF)).conf
|
self.CONF = self.useFixture(cfg_fixture.Config(CONF)).conf
|
||||||
self.context = self.get_context()
|
self.context = self.get_context()
|
||||||
|
|
||||||
self.CONF.set_override(
|
self.CONF.set_override(
|
||||||
@ -182,7 +185,7 @@ class AttributeSchedulerPermutationsTest(tests.TestCase):
|
|||||||
class DefaultSchedulerPermutationsTest(tests.TestCase):
|
class DefaultSchedulerPermutationsTest(tests.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super().setUp()
|
super().setUp()
|
||||||
self.CONF = self.useFixture(cfg_fixture.Config(cfg.CONF)).conf
|
self.CONF = self.useFixture(cfg_fixture.Config(CONF)).conf
|
||||||
self.context = self.get_context()
|
self.context = self.get_context()
|
||||||
|
|
||||||
self.CONF.set_override(
|
self.CONF.set_override(
|
||||||
@ -214,7 +217,7 @@ class DefaultSchedulerPermutationsTest(tests.TestCase):
|
|||||||
class FallbackSchedulerPermutationsTest(tests.TestCase):
|
class FallbackSchedulerPermutationsTest(tests.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super().setUp()
|
super().setUp()
|
||||||
self.CONF = self.useFixture(cfg_fixture.Config(cfg.CONF)).conf
|
self.CONF = self.useFixture(cfg_fixture.Config(CONF)).conf
|
||||||
self.context = self.get_context()
|
self.context = self.get_context()
|
||||||
|
|
||||||
self.CONF.set_override(
|
self.CONF.set_override(
|
||||||
|
@ -9,19 +9,18 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.mport threading
|
# under the License.mport threading
|
||||||
|
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate.notification_handler import fake
|
from designate.notification_handler import fake
|
||||||
from designate.sink import service
|
from designate.sink import service
|
||||||
from designate.tests import fixtures
|
from designate.tests import fixtures
|
||||||
from designate.tests import test_notification_handler
|
from designate.tests import test_notification_handler
|
||||||
|
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class TestSinkNotification(oslotest.base.BaseTestCase,
|
class TestSinkNotification(oslotest.base.BaseTestCase,
|
||||||
|
@ -9,13 +9,13 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate.storage import sqlalchemy
|
from designate.storage import sqlalchemy
|
||||||
CONF = cfg.CONF
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class SqlalchemyTestCase(oslotest.base.BaseTestCase):
|
class SqlalchemyTestCase(oslotest.base.BaseTestCase):
|
||||||
|
@ -18,7 +18,6 @@ from unittest import mock
|
|||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
import fixtures
|
import fixtures
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_messaging.rpc import dispatcher as rpc_dispatcher
|
from oslo_messaging.rpc import dispatcher as rpc_dispatcher
|
||||||
@ -27,12 +26,15 @@ import testtools
|
|||||||
|
|
||||||
import designate.central.service
|
import designate.central.service
|
||||||
from designate.central.service import Service
|
from designate.central.service import Service
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate import objects
|
from designate import objects
|
||||||
from designate.storage import sqlalchemy
|
from designate.storage import sqlalchemy
|
||||||
from designate.tests.fixtures import random_seed
|
from designate.tests.fixtures import random_seed
|
||||||
from designate.tests import TestCase
|
from designate.tests import TestCase
|
||||||
|
|
||||||
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -222,7 +224,7 @@ class NotMockedError(NotImplementedError):
|
|||||||
class CentralBasic(TestCase):
|
class CentralBasic(TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super().setUp()
|
super().setUp()
|
||||||
self.CONF = self.useFixture(cfg_fixture.Config(cfg.CONF)).conf
|
self.CONF = self.useFixture(cfg_fixture.Config(CONF)).conf
|
||||||
self.CONF([], project='designate')
|
self.CONF([], project='designate')
|
||||||
mock_storage = mock.Mock(spec=sqlalchemy.SQLAlchemyStorage)
|
mock_storage = mock.Mock(spec=sqlalchemy.SQLAlchemyStorage)
|
||||||
|
|
||||||
@ -279,7 +281,7 @@ class CentralBasic(TestCase):
|
|||||||
|
|
||||||
class CentralServiceTestCase(CentralBasic):
|
class CentralServiceTestCase(CentralBasic):
|
||||||
def test_conf_fixture(self):
|
def test_conf_fixture(self):
|
||||||
assert 'service:central' in cfg.CONF
|
assert 'service:central' in CONF
|
||||||
|
|
||||||
def test_init(self):
|
def test_init(self):
|
||||||
self.assertTrue(self.service.check_for_tlds)
|
self.assertTrue(self.service.check_for_tlds)
|
||||||
@ -633,7 +635,7 @@ class CentralZoneTestCase(CentralBasic):
|
|||||||
|
|
||||||
def test_is_valid_recordset_name_too_long(self):
|
def test_is_valid_recordset_name_too_long(self):
|
||||||
zone = RoObject(name='example.org.')
|
zone = RoObject(name='example.org.')
|
||||||
cfg.CONF['service:central'].max_recordset_name_len = 255
|
CONF['service:central'].max_recordset_name_len = 255
|
||||||
rs_name = 'a' * 255 + '.org.'
|
rs_name = 'a' * 255 + '.org.'
|
||||||
with testtools.ExpectedException(exceptions.InvalidRecordSetName) as e:
|
with testtools.ExpectedException(exceptions.InvalidRecordSetName) as e:
|
||||||
self.service._is_valid_recordset_name(self.context, zone, rs_name)
|
self.service._is_valid_recordset_name(self.context, zone, rs_name)
|
||||||
@ -1831,8 +1833,8 @@ class CentralStatusTests(CentralBasic):
|
|||||||
class CentralQuotaTest(unittest.TestCase):
|
class CentralQuotaTest(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.CONF = cfg_fixture.Config(cfg.CONF)
|
self.CONF = cfg_fixture.Config(CONF)
|
||||||
cfg.CONF([], project='designate')
|
CONF([], project='designate')
|
||||||
self.CONF.config(quota_driver="noop")
|
self.CONF.config(quota_driver="noop")
|
||||||
self.context = mock.Mock()
|
self.context = mock.Mock()
|
||||||
self.zone = mock.Mock()
|
self.zone = mock.Mock()
|
||||||
|
@ -12,12 +12,13 @@
|
|||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
import dns.message
|
import dns.message
|
||||||
from oslo_config import cfg
|
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import dnsmiddleware
|
from designate import dnsmiddleware
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class TestDNSMiddleware(oslotest.base.BaseTestCase):
|
class TestDNSMiddleware(oslotest.base.BaseTestCase):
|
||||||
|
@ -23,14 +23,15 @@ import dns.rcode
|
|||||||
import dns.rdatatype
|
import dns.rdatatype
|
||||||
import dns.zone
|
import dns.zone
|
||||||
import eventlet
|
import eventlet
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import dnsutils
|
from designate import dnsutils
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class TestDNSUtils(oslotest.base.BaseTestCase):
|
class TestDNSUtils(oslotest.base.BaseTestCase):
|
||||||
|
@ -14,16 +14,17 @@
|
|||||||
import time
|
import time
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
from oslo_service import loopingcall
|
from oslo_service import loopingcall
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import heartbeat_emitter
|
from designate import heartbeat_emitter
|
||||||
from designate import objects
|
from designate import objects
|
||||||
from designate.tests import fixtures
|
from designate.tests import fixtures
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class HeartbeatEmitterTest(oslotest.base.BaseTestCase):
|
class HeartbeatEmitterTest(oslotest.base.BaseTestCase):
|
||||||
@ -105,7 +106,7 @@ class RpcEmitterTest(oslotest.base.BaseTestCase):
|
|||||||
|
|
||||||
mock_service_status.assert_called_once_with(
|
mock_service_status.assert_called_once_with(
|
||||||
service_name='svc',
|
service_name='svc',
|
||||||
hostname=cfg.CONF.host,
|
hostname=CONF.host,
|
||||||
status='UP',
|
status='UP',
|
||||||
stats={},
|
stats={},
|
||||||
capabilities={},
|
capabilities={},
|
||||||
|
@ -13,19 +13,20 @@ import errno
|
|||||||
import socket
|
import socket
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
from oslo_service import service
|
from oslo_service import service
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
from designate.common import profiler
|
from designate.common import profiler
|
||||||
|
import designate.conf
|
||||||
from designate.mdns import handler
|
from designate.mdns import handler
|
||||||
from designate import policy
|
from designate import policy
|
||||||
from designate import rpc
|
from designate import rpc
|
||||||
from designate import service as designate_service
|
from designate import service as designate_service
|
||||||
from designate import utils
|
from designate import utils
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class TestBaseService(oslotest.base.BaseTestCase):
|
class TestBaseService(oslotest.base.BaseTestCase):
|
||||||
|
@ -14,15 +14,16 @@ from unittest import mock
|
|||||||
|
|
||||||
import jinja2
|
import jinja2
|
||||||
from oslo_concurrency import processutils
|
from oslo_concurrency import processutils
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate.tests import fixtures
|
from designate.tests import fixtures
|
||||||
from designate import utils
|
from designate import utils
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class TestUtils(oslotest.base.BaseTestCase):
|
class TestUtils(oslotest.base.BaseTestCase):
|
||||||
|
@ -13,12 +13,12 @@
|
|||||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.mport threading
|
# under the License.mport threading
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from designate.central import rpcapi as central_rpcapi
|
from designate.central import rpcapi as central_rpcapi
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate import objects
|
from designate import objects
|
||||||
import designate.quota.base
|
import designate.quota.base
|
||||||
@ -28,7 +28,7 @@ from designate.worker import rpcapi as worker_rpcapi
|
|||||||
from designate.worker.tasks import base
|
from designate.worker.tasks import base
|
||||||
|
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class TestTask(oslotest.base.BaseTestCase):
|
class TestTask(oslotest.base.BaseTestCase):
|
||||||
|
@ -19,15 +19,16 @@ from unittest import mock
|
|||||||
import dns
|
import dns
|
||||||
import dns.rdataclass
|
import dns.rdataclass
|
||||||
import dns.rdatatype
|
import dns.rdatatype
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import dnsutils
|
from designate import dnsutils
|
||||||
from designate.tests.unit import RoObject
|
from designate.tests.unit import RoObject
|
||||||
from designate.worker.tasks import zone as worker_zone
|
from designate.worker.tasks import zone as worker_zone
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class WorkerNotifyTest(oslotest.base.BaseTestCase):
|
class WorkerNotifyTest(oslotest.base.BaseTestCase):
|
||||||
|
@ -15,16 +15,16 @@
|
|||||||
# under the License.mport threading
|
# under the License.mport threading
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate.tests import fixtures
|
from designate.tests import fixtures
|
||||||
from designate.tests import TestCase
|
from designate.tests import TestCase
|
||||||
from designate.worker import processing
|
from designate.worker import processing
|
||||||
|
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class TestProcessingExecutor(TestCase):
|
class TestProcessingExecutor(TestCase):
|
||||||
|
@ -15,13 +15,13 @@
|
|||||||
# under the License.mport threading
|
# under the License.mport threading
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
import oslo_messaging as messaging
|
import oslo_messaging as messaging
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
from designate import backend
|
from designate import backend
|
||||||
from designate.central import rpcapi as central_rpcapi
|
from designate.central import rpcapi as central_rpcapi
|
||||||
|
import designate.conf
|
||||||
from designate import exceptions
|
from designate import exceptions
|
||||||
from designate import objects
|
from designate import objects
|
||||||
import designate.service
|
import designate.service
|
||||||
@ -31,7 +31,8 @@ from designate.tests import fixtures
|
|||||||
from designate.worker import processing
|
from designate.worker import processing
|
||||||
from designate.worker import service
|
from designate.worker import service
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class TestService(oslotest.base.BaseTestCase):
|
class TestService(oslotest.base.BaseTestCase):
|
||||||
|
@ -13,9 +13,10 @@ from oslo_config import cfg
|
|||||||
from oslo_config import fixture as cfg_fixture
|
from oslo_config import fixture as cfg_fixture
|
||||||
import oslotest.base
|
import oslotest.base
|
||||||
|
|
||||||
|
import designate.conf
|
||||||
from designate.worker.tasks import base
|
from designate.worker.tasks import base
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = designate.conf.CONF
|
||||||
|
|
||||||
|
|
||||||
class TestTaskConfig(oslotest.base.BaseTestCase):
|
class TestTaskConfig(oslotest.base.BaseTestCase):
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user