MCPcopy Create free account
hub / github.com/rthalley/dnspython / absent

Method absent

dns/update.py:319–351  ·  view source on GitHub ↗

Require that an owner name (and optionally an rdata type) does not exist as a prerequisite to the execution of the update.

(
        self,
        name: dns.name.Name | str,
        rdtype: dns.rdatatype.RdataType | str | None = None,
    )

Source from the content-addressed store, hash-verified

317 )
318
319 def absent(
320 self,
321 name: dns.name.Name | str,
322 rdtype: dns.rdatatype.RdataType | str | None = None,
323 ) -> None:
324 """Require that an owner name (and optionally an rdata type) does
325 not exist as a prerequisite to the execution of the update."""
326
327 if isinstance(name, str):
328 name = dns.name.from_text(name, None)
329 if rdtype is None:
330 self.find_rrset(
331 self.prerequisite,
332 name,
333 dns.rdataclass.NONE,
334 dns.rdatatype.ANY,
335 dns.rdatatype.NONE,
336 None,
337 True,
338 True,
339 )
340 else:
341 rdtype = dns.rdatatype.RdataType.make(rdtype)
342 self.find_rrset(
343 self.prerequisite,
344 name,
345 dns.rdataclass.NONE,
346 rdtype,
347 dns.rdatatype.NONE,
348 None,
349 True,
350 True,
351 )
352
353 def _get_one_rr_per_rrset(self, value):
354 # Updates are always one_rr_per_rrset

Callers 4

test_to_wire1Method · 0.80
test_to_wire2Method · 0.80
test_to_wire3Method · 0.80

Calls 3

from_textMethod · 0.45
find_rrsetMethod · 0.45
makeMethod · 0.45

Tested by 4

test_to_wire1Method · 0.64
test_to_wire2Method · 0.64
test_to_wire3Method · 0.64