Deprecate designate-sink non managed mode

This inserts a deprecation notice for notification_handler plugins
that use the _create and _delete calls with "managed=False"

Change-Id: I62906c88a0b0f27007ec45cfdd73ac3e199c152c
Closes-Bug: 1387662
This commit is contained in:
Graham Hayes 2015-02-24 13:39:09 +00:00
parent 795671a16a
commit 237c052f47
1 changed files with 11 additions and 1 deletions

View File

@ -22,6 +22,7 @@ from oslo_log import log as logging
from designate import exceptions
from designate.central import rpcapi as central_rpcapi
from designate.context import DesignateContext
from designate.i18n import _LW
from designate.objects import Record
from designate.objects import RecordSet
from designate.plugin import ExtensionPlugin
@ -118,6 +119,11 @@ class BaseAddressHandler(NotificationHandler):
:param resource_type: The managed resource type
:param resource_id: The managed resource ID
"""
if not managed:
LOG.warning(_LW(
'Deprecation notice: Unmanaged designate-sink records are '
'being deprecated please update the call '
'to remove managed=False'))
LOG.debug('Using DomainID: %s' % cfg.CONF[self.name].domain_id)
domain = self.get_domain(cfg.CONF[self.name].domain_id)
LOG.debug('Domain: %r' % domain)
@ -165,7 +171,11 @@ class BaseAddressHandler(NotificationHandler):
:param criterion: Criterion to search and destroy records
"""
if not managed:
LOG.warning(_LW(
'Deprecation notice: Unmanaged designate-sink records are '
'being deprecated please update the call '
'to remove managed=False'))
criterion = criterion or {}
context = DesignateContext.get_admin_context(all_tenants=True)