Skip to content
Extraits de code Groupes Projets
Valider 0740eb07 rédigé par François De Keersmaeker's avatar François De Keersmaeker
Parcourir les fichiers

Fixed resource usage: close Fabric connection

parent 5a7cac9c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Pipeline #108883 en échec
...@@ -87,13 +87,13 @@ def update_dns_table( ...@@ -87,13 +87,13 @@ def update_dns_table(
## Unbound runs on a remote host ## Unbound runs on a remote host
# SSH connection with remote host # SSH connection with remote host
ssh_config = Config(overrides={"run": {"hide": True}}) ssh_config = Config(overrides={"run": {"hide": True}})
remote = Connection(host, config=ssh_config) with Connection(host, config=ssh_config) as remote:
# Get the DNS cache # Get the DNS cache
result = remote.run(cmd) result = remote.run(cmd, warn=True)
dns_cache = result.stdout.strip().split("\n") if not result.failed:
# Free resources dns_cache = result.stdout.strip().split("\n")
del remote # Free resources
del result del result
else: else:
# Read DNS cache from file # Read DNS cache from file
......
...@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" ...@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "dns-unbound-cache-reader" name = "dns-unbound-cache-reader"
version = "0.3.0" version = "0.4.0"
description = "Read DNS cache from unbound" description = "Read DNS cache from unbound"
readme = "README.md" readme = "README.md"
requires-python = ">=3.8" requires-python = ">=3.8"
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter