diff options
-rw-r--r-- | LICENSE | 4 | ||||
-rw-r--r-- | pylintrc.toml | 2 | ||||
-rwxr-xr-x | simpleddns.py | 20 |
3 files changed, 24 insertions, 2 deletions
@@ -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 '' |