mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-04-04 10:38:52 +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
|
not-an-iterable, # TODO: needs better typing info
|
||||||
protected-access,
|
protected-access,
|
||||||
redefined-outer-name, # needed for test fixtures
|
redefined-outer-name, # needed for test fixtures
|
||||||
simplifiable-if-expression,
|
|
||||||
subprocess-popen-preexec-fn,
|
subprocess-popen-preexec-fn,
|
||||||
unexpected-keyword-arg,
|
unexpected-keyword-arg,
|
||||||
unnecessary-dunder-call,
|
unnecessary-dunder-call,
|
||||||
|
|||||||
@ -239,7 +239,7 @@ class Connection(ConnectionBase):
|
|||||||
host=self.get_option("remote_addr"),
|
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 = {
|
data = {
|
||||||
"Container": self.get_option("remote_addr"),
|
"Container": self.get_option("remote_addr"),
|
||||||
|
|||||||
@ -42,7 +42,7 @@ class Container(DockerBaseClass):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def exists(self):
|
def exists(self):
|
||||||
return True if self.container else False
|
return bool(self.container)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def removing(self):
|
def removing(self):
|
||||||
|
|||||||
@ -101,7 +101,7 @@ def main():
|
|||||||
|
|
||||||
client.module.exit_json(
|
client.module.exit_json(
|
||||||
changed=False,
|
changed=False,
|
||||||
exists=(True if container else False),
|
exists=bool(container),
|
||||||
container=container,
|
container=container,
|
||||||
)
|
)
|
||||||
except DockerException as e:
|
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):
|
def context_to_json(context, current):
|
||||||
module_config = {}
|
module_config = {}
|
||||||
if "docker" in context.endpoints:
|
if "docker" in context.endpoints:
|
||||||
@ -240,7 +236,7 @@ def context_to_json(context, current):
|
|||||||
module_config["validate_certs"] = tls_cfg.verify
|
module_config["validate_certs"] = tls_cfg.verify
|
||||||
module_config["tls"] = True
|
module_config["tls"] = True
|
||||||
else:
|
else:
|
||||||
module_config["tls"] = to_bool(endpoint.get("SkipTLSVerify"))
|
module_config["tls"] = bool(endpoint.get("SkipTLSVerify"))
|
||||||
return {
|
return {
|
||||||
"current": current,
|
"current": current,
|
||||||
"name": context.name,
|
"name": context.name,
|
||||||
|
|||||||
@ -122,7 +122,7 @@ def main():
|
|||||||
|
|
||||||
client.module.exit_json(
|
client.module.exit_json(
|
||||||
changed=False,
|
changed=False,
|
||||||
exists=(True if network else False),
|
exists=bool(network),
|
||||||
network=network,
|
network=network,
|
||||||
)
|
)
|
||||||
except DockerException as e:
|
except DockerException as e:
|
||||||
|
|||||||
@ -106,7 +106,7 @@ def main():
|
|||||||
|
|
||||||
client.module.exit_json(
|
client.module.exit_json(
|
||||||
changed=False,
|
changed=False,
|
||||||
exists=(True if volume else False),
|
exists=bool(volume),
|
||||||
volume=volume,
|
volume=volume,
|
||||||
)
|
)
|
||||||
except DockerException as e:
|
except DockerException as e:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user