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

Method __init__

dns/zone.py:1013–1027  ·  view source on GitHub ↗
(self, zone: Zone, replacement: bool = False)

Source from the content-addressed store, hash-verified

1011
1012class WritableVersion(Version):
1013 def __init__(self, zone: Zone, replacement: bool = False):
1014 # The zone._versions_lock must be held by our caller in a versioned
1015 # zone.
1016 id = zone._get_next_version_id()
1017 super().__init__(zone, id)
1018 if not replacement:
1019 # We copy the map, because that gives us a simple and thread-safe
1020 # way of doing versions, and we have a garbage collector to help
1021 # us. We only make new node objects if we actually change the
1022 # node.
1023 self.nodes.update(zone.nodes)
1024 # We have to copy the zone origin as it may be None in the first
1025 # version, and we don't want to mutate the zone until we commit.
1026 self.origin = zone.origin
1027 self.changed: Set[dns.name.Name] = set()
1028
1029 def _maybe_cow_with_name(
1030 self, name: dns.name.Name

Callers

nothing calls this directly

Calls 3

_get_next_version_idMethod · 0.45
__init__Method · 0.45
updateMethod · 0.45

Tested by

no test coverage detected