mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-03-15 19:58:28 +00:00
Address simplifiable-if-expression.
This commit is contained in:
parent
23d3b126db
commit
8c18085757
@ -389,7 +389,6 @@ disable=raw-checker-failed,
|
||||
not-an-iterable, # TODO: needs better typing info
|
||||
protected-access,
|
||||
redefined-outer-name, # needed for test fixtures
|
||||
simplifiable-if-expression,
|
||||
subprocess-popen-preexec-fn,
|
||||
unexpected-keyword-arg,
|
||||
unnecessary-dunder-call,
|
||||
|
||||
@ -239,7 +239,7 @@ class Connection(ConnectionBase):
|
||||
host=self.get_option("remote_addr"),
|
||||
)
|
||||
|
||||
need_stdin = True if (in_data is not None) or do_become else False
|
||||
need_stdin = bool((in_data is not None) or do_become)
|
||||
|
||||
data = {
|
||||
"Container": self.get_option("remote_addr"),
|
||||
|
||||
@ -42,7 +42,7 @@ class Container(DockerBaseClass):
|
||||
|
||||
@property
|
||||
def exists(self):
|
||||
return True if self.container else False
|
||||
return bool(self.container)
|
||||
|
||||
@property
|
||||
def removing(self):
|
||||
|
||||
@ -101,7 +101,7 @@ def main():
|
||||
|
||||
client.module.exit_json(
|
||||
changed=False,
|
||||
exists=(True if container else False),
|
||||
exists=bool(container),
|
||||
container=container,
|
||||
)
|
||||
except DockerException as e:
|
||||
|
||||
@ -204,10 +204,6 @@ def tls_context_to_json(context):
|
||||
}
|
||||
|
||||
|
||||
def to_bool(value):
|
||||
return True if value else False
|
||||
|
||||
|
||||
def context_to_json(context, current):
|
||||
module_config = {}
|
||||
if "docker" in context.endpoints:
|
||||
@ -240,7 +236,7 @@ def context_to_json(context, current):
|
||||
module_config["validate_certs"] = tls_cfg.verify
|
||||
module_config["tls"] = True
|
||||
else:
|
||||
module_config["tls"] = to_bool(endpoint.get("SkipTLSVerify"))
|
||||
module_config["tls"] = bool(endpoint.get("SkipTLSVerify"))
|
||||
return {
|
||||
"current": current,
|
||||
"name": context.name,
|
||||
|
||||
@ -122,7 +122,7 @@ def main():
|
||||
|
||||
client.module.exit_json(
|
||||
changed=False,
|
||||
exists=(True if network else False),
|
||||
exists=bool(network),
|
||||
network=network,
|
||||
)
|
||||
except DockerException as e:
|
||||
|
||||
@ -106,7 +106,7 @@ def main():
|
||||
|
||||
client.module.exit_json(
|
||||
changed=False,
|
||||
exists=(True if volume else False),
|
||||
exists=bool(volume),
|
||||
volume=volume,
|
||||
)
|
||||
except DockerException as e:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user