From 26633cea82b31ea3fa605e866c3af1a9d0001e54 Mon Sep 17 00:00:00 2001 From: pommicket Date: Mon, 1 Sep 2025 10:39:25 -0400 Subject: list records with pydo --- LICENSE | 4 ++++ pylintrc.toml | 2 +- simpleddns.py | 20 +++++++++++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fe83f06 --- /dev/null +++ b/LICENSE @@ -0,0 +1,4 @@ +ABBREVIATED WHAT THE FUCK PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/pylintrc.toml b/pylintrc.toml index 351ed06..d7f2d64 100644 --- a/pylintrc.toml +++ b/pylintrc.toml @@ -318,7 +318,7 @@ max-module-lines = 1000 [tool.pylint.imports] # List of modules that can be imported at any level, not just the top level one. -allow-any-import-level = ["boto3", "botocore"] +allow-any-import-level = ["boto3", "botocore", "pydo"] # Allow explicit reexports by alias from a package __init__. # allow-reexport-from-package = diff --git a/simpleddns.py b/simpleddns.py index 58551ef..7c05e1c 100755 --- a/simpleddns.py +++ b/simpleddns.py @@ -439,17 +439,35 @@ class LinodeDomain(Domain): class DigitalOceanDomain(Domain): '''Domain registered with DigitalOcean Domains''' access_token: str + _client: Any def _init(self) -> None: pass def update(self, ips: list[str]) -> bool: - print('TODO',self.access_token) + client = self._client + a_records = client.domains.list_records( + domain_name=self.root_domain, + name=self.full_domain, + type='A', + per_page=200 + ) + sleep(self._request_delay()) + aaaa_records = client.domains.list_records( + domain_name=self.root_domain, + name=self.full_domain, + type='AAAA', + per_page=200 + ) + sleep(self._request_delay()) + print(a_records,aaaa_records) return True def validate_specifics(self) -> str: if not getattr(self, 'access_token', ''): return 'Access token not set' + import pydo # pylint: disable=import-error + self._client = pydo.Client(token=self.access_token) # OK return '' -- cgit v1.2.3