mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
PEP 8 whitespace cleanup. (#20783)
* PEP 8 E271 whitespace cleanup. * PEP 8 W293 whitespace cleanup. * Fix whitespace issue from recent PR.
This commit is contained in:
@@ -161,7 +161,7 @@ def install_plugin(module, plugin_bin, plugin_name, version, url, proxy_host, pr
|
||||
if rc != 0:
|
||||
reason = parse_error(out)
|
||||
module.fail_json(msg=reason)
|
||||
|
||||
|
||||
return True, cmd, out, err
|
||||
|
||||
def remove_plugin(module, plugin_bin, plugin_name):
|
||||
@@ -177,7 +177,7 @@ def remove_plugin(module, plugin_bin, plugin_name):
|
||||
if rc != 0:
|
||||
reason = parse_error(out)
|
||||
module.fail_json(msg=reason)
|
||||
|
||||
|
||||
return True, cmd, out, err
|
||||
|
||||
def main():
|
||||
|
||||
@@ -181,7 +181,7 @@ def install_plugin(module, plugin_bin, plugin_name, url, timeout):
|
||||
if rc != 0:
|
||||
reason = parse_error(out)
|
||||
module.fail_json(msg=reason)
|
||||
|
||||
|
||||
return True, cmd, out, err
|
||||
|
||||
def remove_plugin(module, plugin_bin, plugin_name):
|
||||
@@ -191,12 +191,12 @@ def remove_plugin(module, plugin_bin, plugin_name):
|
||||
|
||||
if module.check_mode:
|
||||
return True, cmd, "check mode", ""
|
||||
|
||||
|
||||
rc, out, err = module.run_command(cmd)
|
||||
if rc != 0:
|
||||
reason = parse_error(out)
|
||||
module.fail_json(msg=reason)
|
||||
|
||||
|
||||
return True, cmd, out, err
|
||||
|
||||
def main():
|
||||
|
||||
@@ -322,7 +322,7 @@ def main():
|
||||
e = get_exception()
|
||||
module.fail_json(msg="unable to connect to database: %s" % e)
|
||||
|
||||
|
||||
|
||||
try:
|
||||
old_value = r.config_get(name)[name]
|
||||
except Exception:
|
||||
|
||||
@@ -179,7 +179,7 @@ def main():
|
||||
ring_size = stats['ring_creation_size']
|
||||
rc, out, err = module.run_command([riak_bin, 'version'] )
|
||||
version = out.strip()
|
||||
|
||||
|
||||
result = dict(node_name=node_name,
|
||||
nodes=nodes,
|
||||
ring_size=ring_size,
|
||||
|
||||
@@ -181,7 +181,7 @@ def main():
|
||||
login_password = module.params['login_password']
|
||||
login_host = module.params['login_host']
|
||||
login_port = module.params['login_port']
|
||||
|
||||
|
||||
login_querystring = login_host
|
||||
if login_port != "1433":
|
||||
login_querystring = "%s:%s" % (login_host, login_port)
|
||||
|
||||
@@ -178,7 +178,7 @@ def main():
|
||||
else:
|
||||
if state == "absent":
|
||||
changed = ext_delete(cursor, ext)
|
||||
|
||||
|
||||
elif state == "present":
|
||||
changed = ext_create(cursor, ext)
|
||||
except NotSupportedError:
|
||||
|
||||
@@ -253,21 +253,21 @@ def main():
|
||||
if lang_exists(cursor, lang):
|
||||
lang_trusted = lang_istrusted(cursor, lang)
|
||||
if (lang_trusted and not trust) or (not lang_trusted and trust):
|
||||
if module.check_mode:
|
||||
if module.check_mode:
|
||||
changed = True
|
||||
else:
|
||||
changed = lang_altertrust(cursor, lang, trust)
|
||||
else:
|
||||
if module.check_mode:
|
||||
if module.check_mode:
|
||||
changed = True
|
||||
else:
|
||||
changed = lang_add(cursor, lang, trust)
|
||||
if force_trust:
|
||||
changed = lang_altertrust(cursor, lang, trust)
|
||||
|
||||
|
||||
else:
|
||||
if lang_exists(cursor, lang):
|
||||
if module.check_mode:
|
||||
if module.check_mode:
|
||||
changed = True
|
||||
kw['lang_dropped'] = True
|
||||
else:
|
||||
|
||||
@@ -688,7 +688,7 @@ def main():
|
||||
module.fail_json(msg=str(e))
|
||||
else:
|
||||
if user_exists(cursor, user):
|
||||
if module.check_mode:
|
||||
if module.check_mode:
|
||||
changed = True
|
||||
kw['user_removed'] = True
|
||||
else:
|
||||
|
||||
@@ -116,7 +116,7 @@ def get_configuration_facts(cursor, parameter_name=''):
|
||||
'current_value': row.current_value,
|
||||
'default_value': row.default_value}
|
||||
return facts
|
||||
|
||||
|
||||
def check(configuration_facts, parameter_name, current_value):
|
||||
parameter_key = parameter_name.lower()
|
||||
if current_value and current_value.lower() != configuration_facts[parameter_key]['current_value'].lower():
|
||||
|
||||
@@ -135,7 +135,7 @@ def update_roles(role_facts, cursor, role,
|
||||
cursor.execute("revoke {0} from {1}".format(assigned_role, role))
|
||||
for assigned_role in set(required) - set(existing):
|
||||
cursor.execute("grant {0} to {1}".format(assigned_role, role))
|
||||
|
||||
|
||||
def check(role_facts, role, assigned_roles):
|
||||
role_key = role.lower()
|
||||
if role_key not in role_facts:
|
||||
|
||||
Reference in New Issue
Block a user