summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorErik Olof Gunnar Andersson <eandersson@blizzard.com>2019-12-23 01:47:58 -0800
committerErik Olof Gunnar Andersson <eandersson@blizzard.com>2019-12-29 02:48:05 +0000
commit4869913519e0b7bb12b4ba1ef6b7ce8aabb53825 (patch)
tree06474097239d2b83283d1d102e87476cefa60744 /contrib
parent0050549441a1889a40b85accc4733d3dca8f067f (diff)
downloaddesignate-4869913519e0b7bb12b4ba1ef6b7ce8aabb53825.tar.gz
Improve sink recordset creation
Reduced the number of calls we need to make when creating records using the sink by better using the create/update recordset api. This also fixes a bug where the sink could trigger a race condition in the worker causing it to throw a BadAction exception. Partial-Bug: #1768618 Change-Id: Iaf21ec59755375d3c3bc043b16a1b14aa991475e
Diffstat (limited to 'contrib')
-rw-r--r--contrib/designate-ext-samplehandler/designate_ext_samplehandler/notification_handler/sample.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/contrib/designate-ext-samplehandler/designate_ext_samplehandler/notification_handler/sample.py b/contrib/designate-ext-samplehandler/designate_ext_samplehandler/notification_handler/sample.py
index 60ce1ae5..56df3b55 100644
--- a/contrib/designate-ext-samplehandler/designate_ext_samplehandler/notification_handler/sample.py
+++ b/contrib/designate-ext-samplehandler/designate_ext_samplehandler/notification_handler/sample.py
@@ -78,8 +78,6 @@ class SampleHandler(NotificationHandler):
'data': fixed_ip['address'],
}
- recordset = self._find_or_create_recordset(context,
- **recordset_values)
-
- self.central_api.create_record(context, zone_id, recordset['id'],
- Record(**record_values))
+ self._create_or_update_recordset(
+ context, [Record(**record_values)], **recordset_values
+ )