Fix user_alter in postgresql_user
This commit is contained in:
parent
ff7a9eb625
commit
b2829cf6b9
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue