Sanjays2402 commented on code in PR #2177:
URL: https://github.com/apache/libcloud/pull/2177#discussion_r4245926724
##########
libcloud/dns/drivers/route53.py:
##########
@@ -199,7 +199,39 @@ def create_record(self, name, zone, type, data,
extra=None):
extra=extra,
)
+ def _with_record_set_metadata(self, record):
+ # ``_multi_value`` / ``_other_records`` are attached by
``_to_records``,
+ # so records which did not come from ``list_records`` / ``get_record``
+ # (e.g. the ones returned by ``create_record`` or
+ # ``ex_create_multi_value_record``, or user constructed ones) carry no
+ # information about the rest of their record set. Re-fetch the record
+ # set in that case so multi value updates and deletes work regardless
+ # of how the record was obtained.
+
+ if "_multi_value" in record.extra:
+ return record
+
+ try:
+ fetched = self.list_records(zone=record.zone)
+ except Exception:
Review Comment:
You were right, thanks. Fixed in the latest push: the record-set metadata
lookup now runs before the try/except instead of inside it.
delete_record calls _with_record_set_metadata() (which does the list_records
re-fetch when the record has no multi-value metadata) up front, outside the
try. So any networking or API error from that lookup propagates as-is now. The
try/except only wraps the changeset submission itself, where it translates
InvalidChangeBatch into RecordDoesNotExistError.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]