mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-03-15 19:58:28 +00:00
Address consider-iterating-dictionary.
This commit is contained in:
parent
1d30856e67
commit
ae53065001
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user