summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-08-30 15:51:05 +0000
committerGerrit Code Review <review@openstack.org>2018-08-30 15:51:05 +0000
commite4f8743737b764783d2107fc0c186db7de093e6d (patch)
tree9a93ae0a0a8afd2fe9167ac59e8a9d484c659e61
parent7166a950831fa4a7d3a8f200ec14ec2f3370363a (diff)
parent116b202d1815b1e0fdcf6a2c7e940b85bcedda06 (diff)
downloaddesignate-e4f8743737b764783d2107fc0c186db7de093e6d.tar.gz
Merge "Removed deprecated managed option in notification handler"
-rw-r--r--designate/notification_handler/base.py54
-rw-r--r--releasenotes/notes/removed-deprecated-managed-210a00cdaf975b8f.yaml7
2 files changed, 26 insertions, 35 deletions
diff --git a/designate/notification_handler/base.py b/designate/notification_handler/base.py
index c7f9cc71..e78192f4 100644
--- a/designate/notification_handler/base.py
+++ b/designate/notification_handler/base.py
@@ -125,8 +125,8 @@ class BaseAddressHandler(NotificationHandler):
self.default_formatv6
)
- def _create(self, addresses, extra, zone_id, managed=True,
- resource_type=None, resource_id=None):
+ def _create(self, addresses, extra, zone_id, resource_type=None,
+ resource_id=None):
"""
Create a record from addresses
@@ -134,15 +134,9 @@ class BaseAddressHandler(NotificationHandler):
{'version': 4, 'ip': '10.0.0.1'}
:param extra: Extra data to use when formatting the record
:param zone_id: The ID of the designate zone.
- :param managed: Is it a managed resource
:param resource_type: The managed resource type
:param resource_id: The managed resource ID
"""
- if not managed:
- LOG.warning(
- 'Deprecation notice: Unmanaged designate-sink records are '
- 'being deprecated please update the call '
- 'to remove managed=False')
LOG.debug('Using Zone ID: %s', zone_id)
zone = self.get_zone(zone_id)
LOG.debug('Domain: %r', zone)
@@ -174,15 +168,13 @@ class BaseAddressHandler(NotificationHandler):
context, **recordset_values)
record_values = {
- 'data': addr['address']}
-
- if managed:
- record_values.update({
- 'managed': managed,
- 'managed_plugin_name': self.get_plugin_name(),
- 'managed_plugin_type': self.get_plugin_type(),
- 'managed_resource_type': resource_type,
- 'managed_resource_id': resource_id})
+ 'data': addr['address'],
+ 'managed': True,
+ 'managed_plugin_name': self.get_plugin_name(),
+ 'managed_plugin_type': self.get_plugin_type(),
+ 'managed_resource_type': resource_type,
+ 'managed_resource_id': resource_id
+ }
LOG.debug('Creating record in %s / %s with values %r',
zone['id'], recordset['id'], record_values)
@@ -191,38 +183,30 @@ class BaseAddressHandler(NotificationHandler):
recordset['id'],
Record(**record_values))
- def _delete(self, zone_id, managed=True, resource_id=None,
- resource_type='instance', criterion=None):
+ def _delete(self, zone_id, resource_id=None, resource_type='instance',
+ criterion=None):
"""
Handle a generic delete of a fixed ip within a zone
:param zone_id: The ID of the designate zone.
- :param managed: Is it a managed resource
:param resource_id: The managed resource ID
:param resource_type: The managed resource type
:param criterion: Criterion to search and destroy records
"""
- if not managed:
- LOG.warning(
- 'Deprecation notice: Unmanaged designate-sink records are '
- 'being deprecated please update the call '
- 'to remove managed=False')
criterion = criterion or {}
context = DesignateContext().elevated()
context.all_tenants = True
context.edit_managed_records = True
- criterion.update({'zone_id': zone_id})
-
- if managed:
- criterion.update({
- 'managed': managed,
- 'managed_plugin_name': self.get_plugin_name(),
- 'managed_plugin_type': self.get_plugin_type(),
- 'managed_resource_id': resource_id,
- 'managed_resource_type': resource_type
- })
+ criterion.update({
+ 'zone_id': zone_id,
+ 'managed': True,
+ 'managed_plugin_name': self.get_plugin_name(),
+ 'managed_plugin_type': self.get_plugin_type(),
+ 'managed_resource_id': resource_id,
+ 'managed_resource_type': resource_type
+ })
records = self.central_api.find_records(context, criterion)
diff --git a/releasenotes/notes/removed-deprecated-managed-210a00cdaf975b8f.yaml b/releasenotes/notes/removed-deprecated-managed-210a00cdaf975b8f.yaml
new file mode 100644
index 00000000..b7376ef0
--- /dev/null
+++ b/releasenotes/notes/removed-deprecated-managed-210a00cdaf975b8f.yaml
@@ -0,0 +1,7 @@
+---
+upgrade:
+ - |
+ Custom notification handlers that created unmanaged records will need to be updated,
+ as we no longer support the creation of unmanaged records using the sink.
+
+ See `designate/notification_handler/base.py` for more details.