Bulk autopep8 (modules)

As agreed in 2017-12-07 Core meeting bulk fix pep8 issues

Generated using:
autopep8 1.3.3 (pycodestyle: 2.3.1)
autopep8 -r  --max-line-length 160 --in-place --ignore E305,E402,E722,E741 lib/ansible/modules

Manually fix issues that autopep8 has introduced
This commit is contained in:
John Barker 2017-12-07 16:27:06 +00:00 committed by John R Barker
parent d13d7e9404
commit c57a7f05e1
314 changed files with 3462 additions and 3383 deletions

View file

@ -99,6 +99,7 @@ def ext_exists(cursor, ext):
cursor.execute(query, {'ext': ext})
return cursor.rowcount == 1
def ext_delete(cursor, ext):
if ext_exists(cursor, ext):
query = "DROP EXTENSION \"%s\"" % ext
@ -107,6 +108,7 @@ def ext_delete(cursor, ext):
else:
return False
def ext_create(cursor, ext):
if not ext_exists(cursor, ext):
query = 'CREATE EXTENSION "%s"' % ext
@ -119,6 +121,7 @@ def ext_create(cursor, ext):
# Module execution.
#
def main():
module = AnsibleModule(
argument_spec=dict(
@ -130,7 +133,7 @@ def main():
ext=dict(required=True, aliases=['name']),
state=dict(default="present", choices=["absent", "present"]),
),
supports_check_mode = True
supports_check_mode=True
)
if not postgresqldb_found:
@ -145,13 +148,13 @@ def main():
# check which values are empty and don't include in the **kw
# dictionary
params_map = {
"login_host":"host",
"login_user":"user",
"login_password":"password",
"port":"port"
"login_host": "host",
"login_user": "user",
"login_password": "password",
"port": "port"
}
kw = dict( (params_map[k], v) for (k, v) in module.params.items()
if k in params_map and v != '' )
kw = dict((params_map[k], v) for (k, v) in module.params.items()
if k in params_map and v != '')
try:
db_connection = psycopg2.connect(database=db, **kw)
# Enable autocommit so we can create databases