- @property
- def existing_leases(self):
- local_data = self._control("list_local_data")
- ret = {}
-
- for line in local_data.splitlines():
- try:
- hostname, ttl, x, record_type, content = line.split("\t")
- except ValueError:
- continue
-
- # Ignore everything that is not A or PTR
- if not record_type in ("A", "PTR"):
- continue
-
- if hostname.endswith("."):
- hostname = hostname[:-1]
-
- if content.endswith("."):
- content = content[:-1]
-
- if record_type == "A":
- ret[hostname] = content
- elif record_type == "PTR":
- ret[content] = reverse_pointer_to_ip_address(hostname)
-
- return ret