mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-30 23:48:54 +00:00
Reformat everything.
This commit is contained in:
parent
3f2213791a
commit
340ff8586d
1008 changed files with 61301 additions and 58309 deletions
|
|
@ -217,6 +217,7 @@ import traceback
|
|||
REDIS_IMP_ERR = None
|
||||
try:
|
||||
from redis import StrictRedis
|
||||
|
||||
HAS_REDIS_PACKAGE = True
|
||||
except ImportError:
|
||||
REDIS_IMP_ERR = traceback.format_exc()
|
||||
|
|
@ -224,7 +225,10 @@ except ImportError:
|
|||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible_collections.community.general.plugins.module_utils.redis import (
|
||||
fail_imports, redis_auth_argument_spec, redis_auth_params)
|
||||
fail_imports,
|
||||
redis_auth_argument_spec,
|
||||
redis_auth_params,
|
||||
)
|
||||
|
||||
|
||||
def redis_client(**client_params):
|
||||
|
|
@ -234,7 +238,7 @@ def redis_client(**client_params):
|
|||
# Module execution.
|
||||
def main():
|
||||
module_args = dict(
|
||||
cluster=dict(type='bool', default=False),
|
||||
cluster=dict(type="bool", default=False),
|
||||
)
|
||||
module_args.update(redis_auth_argument_spec(tls_default=False))
|
||||
module = AnsibleModule(
|
||||
|
|
@ -242,10 +246,10 @@ def main():
|
|||
supports_check_mode=True,
|
||||
)
|
||||
|
||||
fail_imports(module, module.params['tls'])
|
||||
fail_imports(module, module.params["tls"])
|
||||
|
||||
redis_params = redis_auth_params(module)
|
||||
cluster = module.params['cluster']
|
||||
cluster = module.params["cluster"]
|
||||
|
||||
# Connect and check
|
||||
client = redis_client(**redis_params)
|
||||
|
|
@ -259,10 +263,10 @@ def main():
|
|||
result = dict(changed=False, info=info)
|
||||
|
||||
if cluster:
|
||||
result['cluster_info'] = client.execute_command('CLUSTER INFO')
|
||||
result["cluster_info"] = client.execute_command("CLUSTER INFO")
|
||||
|
||||
module.exit_json(**result)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue