Update for modern Python compatibility #1

Merged
hendrik-hog merged 7 commits from update into master 2025-11-20 03:38:16 +01:00
4 changed files with 10 additions and 5 deletions
Showing only changes of commit 6cbaf08cfc - Show all commits

3
.gitignore vendored
View File

@@ -1,4 +1,5 @@
.venv
corenetworks-credentials.ini
.python-version
**.pyc
**.pyc
certbot-test

View File

@@ -62,7 +62,9 @@ class Authenticator(dns_common.DNSAuthenticator):
def _get_corenetworks_client(self):
return _CoreNetworksAPIClient(
self.credentials.conf("login"), self.credentials.conf("password"), self.ttl
self.credentials.conf("username"),
self.credentials.conf("password"),
self.ttl,
)
@@ -71,8 +73,8 @@ class _CoreNetworksAPIClient:
Encapsulates all communication with the Core Networks API.
"""
def __init__(self, login, password, ttl):
self.login = login
def __init__(self, username, password, ttl):
self.username = username
self.password = password
self.ttl = ttl
self.token = None
@@ -83,9 +85,11 @@ class _CoreNetworksAPIClient:
return self.token
try:
print(self.username)
print(self.password)
response = requests.post(
f"{API_BASE_URL}/auth/token",
json={"login": self.login, "password": self.password},
json={"login": self.username, "password": self.password},
timeout=30,
)
response.raise_for_status()