From 4869913519e0b7bb12b4ba1ef6b7ce8aabb53825 Mon Sep 17 00:00:00 2001 From: Erik Olof Gunnar Andersson Date: Mon, 23 Dec 2019 01:47:58 -0800 Subject: 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 --- .../designate_ext_samplehandler/notification_handler/sample.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'contrib') 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 + ) -- cgit v1.2.1