Port postgresql module to python3 (#4579)

Iteritems is no longer a dict method in Python3, replace it with
the six wrapper.
This commit is contained in:
Michael Scherer 2016-08-31 17:08:12 +02:00 committed by Matt Clay
parent 839d5b6de4
commit f59af7d29e
2 changed files with 18 additions and 20 deletions

View file

@ -114,6 +114,7 @@ except ImportError:
postgresqldb_found = False
else:
postgresqldb_found = True
from ansible.module_utils.six import iteritems
class NotSupportedError(Exception):
pass
@ -261,7 +262,7 @@ def main():
"login_password":"password",
"port":"port"
}
kw = dict( (params_map[k], v) for (k, v) in module.params.iteritems()
kw = dict( (params_map[k], v) for (k, v) in iteritems(module.params)
if k in params_map and v != '' )
# If a login_unix_socket is specified, incorporate it here.