diff options
author | Devin Christensen <quixoten@gmail.com> | 2014-11-25 12:04:47 -0700 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2014-11-26 21:19:39 -0600 |
commit | 8449b7f5fae329fe914df1f417ce8a5e9a485e9a (patch) | |
tree | b0f7a83d82bc8426cd03bd2cf301e4393bfa5c28 | |
parent | 10766ff26a6bdcaea16e51eeadf8cabb6904114b (diff) | |
download | ansible-modules-core-8449b7f5fae329fe914df1f417ce8a5e9a485e9a.tar.gz |
Fix user_alter in postgresql_user
-rw-r--r-- | database/postgresql/postgresql_user.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/database/postgresql/postgresql_user.py b/database/postgresql/postgresql_user.py index d7cca2fc..421831e8 100644 --- a/database/postgresql/postgresql_user.py +++ b/database/postgresql/postgresql_user.py @@ -218,7 +218,7 @@ def user_alter(cursor, module, user, password, role_attr_flags, encrypted, expir # Grab current role attributes. current_role_attrs = cursor.fetchone() - alter = ['ALTER USER "%(user)s"' % {"user": pg_quote_identifier(user, 'role')}] + alter = ['ALTER USER %(user)s' % {"user": pg_quote_identifier(user, 'role')}] if password is not None: alter.append("WITH %(crypt)s" % {"crypt": encrypted}) alter.append("PASSWORD %(password)s") @@ -229,7 +229,7 @@ def user_alter(cursor, module, user, password, role_attr_flags, encrypted, expir alter.append("VALID UNTIL %(expires)s") try: - cursor.execute(alter, query_password_data) + cursor.execute(' '.join(alter), query_password_data) except psycopg2.InternalError, e: if e.pgcode == '25006': # Handle errors due to read-only transactions indicated by pgcode 25006 |