mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
docker_swarm_service: Use option_minimal_versions (#50609)
* Pass client to detect_usage function * Use new client argument in detect_usage function * Use option_minimal_versions * Add min_docker_api_version * Skip default since publish is always a list * Add min Docker API version to module requirements * Remove redundant keys() * Move detect_ipvX_address_usage out of __init__ * Check for mode presence in publish ports * Remove unused import * Use port.get(‘mode’) to check for falsy values * Update lib/ansible/modules/cloud/docker/docker_swarm_service.py Co-Authored-By: hannseman <hannes@5monkeys.se> * Add force_update to option_minimal_versions * Detect publish mode better * Add a trailing comma
This commit is contained in:
parent
ab70172651
commit
420c24ea55
3 changed files with 44 additions and 42 deletions
|
@ -442,7 +442,7 @@ class AnsibleDockerClient(Client):
|
|||
if not data['supported']:
|
||||
# Test whether option is specified
|
||||
if 'detect_usage' in data:
|
||||
used = data['detect_usage']()
|
||||
used = data['detect_usage'](self)
|
||||
else:
|
||||
used = self.module.params.get(option) is not None
|
||||
if used and 'default' in self.module.argument_spec[option]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue