From patchwork Fri May 14 11:53:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 4272 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4FhRk96cJ3z44RW for ; Fri, 14 May 2021 11:53:21 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4FhRk84wVVzcb; Fri, 14 May 2021 11:53:20 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4FhRk83hBZz2ylJ; Fri, 14 May 2021 11:53:20 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4FhRk73SYXz2xCy for ; Fri, 14 May 2021 11:53:19 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4FhRk66Tyczcb; Fri, 14 May 2021 11:53:18 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1620993199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=9DRavwFi+yu5zUi+q2Dlg3Y7Ia1eX5OdyGd5nmAJ35A=; b=LwX5qfy31/nJUO8c9s4lihVHosVpAJxP5y0H28qwudkKSiZWn9aIqFuCVzYJeAb5cE6mEJ XvuPqP/nUMootGAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1620993199; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=9DRavwFi+yu5zUi+q2Dlg3Y7Ia1eX5OdyGd5nmAJ35A=; b=mHjoTlrQub+YIDJS+P3RQNbqqnv58qZS0ghczWGh1kOu8bOZHnyFGunE4B3rL9+vJ/iTAY PJHzxcflBXDG2k97uluYjYnWm8pQZKMi+iPDIM0E6Bm8ShVwQJZrQnOIFeYM9PiRpLAXfB 2oUZp7/a9dfgVLjZIfRSo7BoECRWbE+f3y6Ed5nfnrM9LUBW8lIC49T5blt5ndMhXNMZFv gSv17E9sZ4ZjZYYWiKZKixveSSKuvoWLvIdt4Os9p3xAajd+WkxwzFsNUPvol2D/Kxnz4j F2V83nSp2/r/5fg80jfu8TX9ABAnRT/vcWxAWE4CPJ/OQfkbByW7gQZQq1vOXQ== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH] unbound-dhcp-leases-bridge: Migrate to Python 3 Date: Fri, 14 May 2021 12:53:11 +0100 Message-Id: <20210514115311.25256-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Michael Tremer Acked-by: Peter Müller --- config/unbound/unbound-dhcp-leases-bridge | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/unbound/unbound-dhcp-leases-bridge b/config/unbound/unbound-dhcp-leases-bridge index e3da4860b..2d8ef1387 100644 --- a/config/unbound/unbound-dhcp-leases-bridge +++ b/config/unbound/unbound-dhcp-leases-bridge @@ -178,8 +178,8 @@ class UnboundDHCPLeasesBridge(object): # Dump everything in the logs log.debug("Static hosts:") - for hostname, addresses in hosts.items(): - log.debug(" %-20s : %s" % (hostname, ", ".join(addresses))) + for name in hosts: + log.debug(" %-20s : %s" % (name, ", ".join(hosts[name]))) return hosts @@ -402,9 +402,9 @@ class Lease(object): address = ipaddress.ip_address(self.ipaddr) - for subnet, domain in subnets.items(): + for subnet in subnets: if address in subnet: - return domain + return subnets[subnet] # Fall back to localdomain if no match could be found return "localdomain"