PEP 8 E111 & E114 cleanup. (#20838)

This commit is contained in:
Matt Clay
2017-01-30 15:01:47 -08:00
committed by GitHub
parent 1609afbd12
commit cb76200c7d
119 changed files with 339 additions and 378 deletions

View File

@@ -236,4 +236,4 @@ from ansible.module_utils.basic import *
from ansible.module_utils.pycompat24 import get_exception
if __name__ == '__main__':
main()
main()

View File

@@ -194,10 +194,10 @@ def main():
cursor = conn.cursor()
except Exception as e:
if "Unknown database" in str(e):
errno, errstr = e.args
module.fail_json(msg="ERROR: %s %s" % (errno, errstr))
errno, errstr = e.args
module.fail_json(msg="ERROR: %s %s" % (errno, errstr))
else:
module.fail_json(msg="unable to connect, check login_user and login_password are correct, or alternatively check your @sysconfdir@/freetds.conf / ${HOME}/.freetds.conf")
module.fail_json(msg="unable to connect, check login_user and login_password are correct, or alternatively check your @sysconfdir@/freetds.conf / ${HOME}/.freetds.conf")
conn.autocommit(True)
changed = False

View File

@@ -223,7 +223,7 @@ def db_create(cursor, db, owner, template, encoding, lc_collate, lc_ctype):
def db_matches(cursor, db, owner, template, encoding, lc_collate, lc_ctype):
if not db_exists(cursor, db):
return False
return False
else:
db_info = get_db_info(cursor, db)
if (encoding and

View File

@@ -139,7 +139,7 @@ def update_roles(role_facts, cursor, role,
def check(role_facts, role, assigned_roles):
role_key = role.lower()
if role_key not in role_facts:
return False
return False
if assigned_roles and cmp(sorted(assigned_roles), sorted(role_facts[role_key]['assigned_roles'])) != 0:
return False
return True

View File

@@ -184,12 +184,12 @@ def update_roles(schema_facts, cursor, schema,
cursor.execute("create role {0}".format(role))
cursor.execute("grant usage on schema {0} to {1}".format(schema, role))
for role in set(create_required) - set(create_existing):
cursor.execute("grant create on schema {0} to {1}".format(schema, role))
cursor.execute("grant create on schema {0} to {1}".format(schema, role))
def check(schema_facts, schema, usage_roles, create_roles, owner):
schema_key = schema.lower()
if schema_key not in schema_facts:
return False
return False
if owner and owner.lower() == schema_facts[schema_key]['owner'].lower():
return False
if cmp(sorted(usage_roles), sorted(schema_facts[schema_key]['usage_roles'])) != 0:

View File

@@ -195,7 +195,7 @@ def check(user_facts, user, profile, resource_pool,
locked, password, expired, ldap, roles):
user_key = user.lower()
if user_key not in user_facts:
return False
return False
if profile and profile != user_facts[user_key]['profile']:
return False
if resource_pool and resource_pool != user_facts[user_key]['resource_pool']: