Address consider-iterating-dictionary.

This commit is contained in:
Felix Fontein 2025-10-11 14:28:02 +02:00
parent 1d30856e67
commit ae53065001
3 changed files with 3 additions and 4 deletions

View File

@ -381,7 +381,6 @@ disable=raw-checker-failed,
# To clean up:
abstract-method,
arguments-differ,
consider-iterating-dictionary,
consider-using-dict-comprehension,
consider-using-f-string,
consider-using-in,

View File

@ -157,7 +157,7 @@ class Context:
def _load_certs(self):
certs = {}
tls_dir = get_tls_dir(self.name)
for endpoint in self.endpoints.keys():
for endpoint in self.endpoints:
if not os.path.isdir(os.path.join(tls_dir, endpoint)):
continue
ca_cert = None
@ -267,7 +267,7 @@ class Context:
key = self.orchestrator
if not key or key == "swarm":
key = "docker"
if key in self.tls_cfg.keys():
if key in self.tls_cfg:
return self.tls_cfg[key]
return None

View File

@ -419,7 +419,7 @@ def parse_bytes(s):
else:
digits_part = s[:-1]
if suffix in units.keys() or suffix.isdigit():
if suffix in units or suffix.isdigit():
try:
digits = float(digits_part)
except ValueError: