diff options
author | Erik Olof Gunnar Andersson <eandersson@blizzard.com> | 2019-12-23 01:47:58 -0800 |
---|---|---|
committer | Erik Olof Gunnar Andersson <eandersson@blizzard.com> | 2019-12-29 02:48:05 +0000 |
commit | 4869913519e0b7bb12b4ba1ef6b7ce8aabb53825 (patch) | |
tree | 06474097239d2b83283d1d102e87476cefa60744 /contrib | |
parent | 0050549441a1889a40b85accc4733d3dca8f067f (diff) | |
download | designate-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.py | 8 |
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 + ) |