Skip to content

Commit

Permalink
We need to use as
Browse files Browse the repository at this point in the history
  • Loading branch information
fupduck committed Jun 20, 2024
1 parent 4eb45e1 commit 8a4e674
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions certbot_dns_hetzner/dns_hetzner.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ def _get_zone(domain):
return '.'.join([zone_name.domain, zone_name.suffix])

def _perform(self, domain, validation_name, validation):
self._get_hetzner_client(domain).create_record("TXT", self._fqdn_format(validation_name), validation)
with self._get_hetzner_client(domain) as client:
client.create_record("TXT", self._fqdn_format(validation_name), validation)

def _cleanup(self, domain, validation_name, validation):
self._get_hetzner_client(domain).delete_record(None, "TXT", self._fqdn_format(validation_name), validation)
with self._get_hetzner_client(domain) as client:
client.delete_record(None, "TXT", self._fqdn_format(validation_name), validation)

def _get_hetzner_client(self, domain):
config = ConfigResolver().with_env().with_dict({
Expand Down

0 comments on commit 8a4e674

Please sign in to comment.